Mr X loves his clock. His clock displays time in the $$ HH:MM $$ Format using the 24 hour system, the first 2 characters in the string are used to display the current hour, with possible leading zeros. Also, the last 2 characters are used to display the current minutes, also with possible leading zeroes.
Now, Mr X came up with a new thing, where he calls a particular time displayed by the clock good if the sum of all digits written on the clock during that time is divisible by a given number $$x$$.
You have been given the current time displayed by the clock and an integer $$ x $$. You need to find the minimum number of minutes Mr X needs to wait, to see a good time being displayed by the clock. If the clock is already displaying a good time, Mr X does not need to wait at all.
If the clock will never ever display a good time, then print $$ -1 $$ instead as the answer.
Input Format:
The first line contains a string in the $$HH:MM$$ format. The next line contains a single integer $$x$$.
Output Format:
Print a single integer denoting the minimum number of minutes Mr X needs to wait to see a good time being displayed by the clock, or $$ -1 $$ if this can never happen.
Constraints :
$$ 0 \le HH < 24 $$
$$ 0 \le MM < 60 $$
$$ 1 \le x < 20 $$