Pepcoder And Alarm

easy
Pepcoder after working for all the day long now went to bed.
But he still have to set alarm for the next day.
He already have his alarm clock set to some other time, being exhausted he want to do minimum number of shifts to set alarm to new time.
Here you can move hour and minute hands of the clock clockwise or anti-clockwise.
One shift changes the hour or minute value by one.
Pepcoder is using a clock in which values are organized cyclic, that mean shifting 0 minute anti-clockwise once will set it to 59 and shifting 59 minute clockwise once will set it to 0.Similarly 23 hour can be changed to 0 in one shift and vice versa.

Print the minimum number of shifts to set the alarm clock to newTime.

Input Format

First line contains 2 space seperated intergers representing current setTime in format HH MM, Second line contains 2 space seperated intergers representing time to set in format HH MM.

Output Format

print single integer minimum number of shifts.

Constraints

0 <= HH <= 23
0 <= MM <= 59

Example

Input
13 43
20 11
Output
35
Previous
Sum In The Tree
Next
Largest Number

Related Questions