eolymp
bolt
Try our new interface for solving problems
Problems

Clocks

Clocks

The driking-clock strikes so many beats every hour as face has them from \textbf{1} to \textbf{12}, and one time when the minute hand indicates \textbf{6} o’clock. Knowing the start and final period of \textbf{24}-hours period( which exposes in hours and minutes), count the general number of strikes for this term. \InputFile Start and end time of one calendar day in hours (\textbf{H}) and minutes (\textbf{M}) by a space (\textbf{0} ≤ \textbf{H} ≤ \textbf{23}, \textbf{0} ≤ \textbf{M} ≤ \textbf{59}). \OutputFile The answer to the problem.
Time limit 1 second
Memory limit 64 MiB
Input example #1
13 30 15 10
Output example #1
7