77-27= 50 so when you add both it add up to 77 ,
50 is the answer
Please see the pic, I'd solved your question in it.
The first digit may be 1 or 8.
The second digit may be 1, 2, 4, 8.
The third digit may be 1, 3, 5, 7, 9.
There are 
The probability that this is the correct code is 