Every Second Counts

Given a start and end clock time, compute how many seconds elapsed, adding 24 hours if the ride crosses midnight.

Easy1MathImplementationNo attempts yetTime limit2sMemory limit512 MB

Problem

Meredith runs a taxi company called Ruber in the small towns of western Pennsylvania. She charges per second instead of per minute, so she needs the exact number of seconds between the moment a client enters a cab and the moment the client leaves it. Read the start time and the end time of one ride and compute the elapsed time in seconds.

Input

The first line contains the start time of a single taxi ride and the second line contains its end time. Both times use the form hh : mm : ss, where the hour, the minute and the second are separated by a colon surrounded by spaces. No value is padded with a leading zero. Meredith uses a 24 hour clock, so 0 : 0 : 0 is midnight and 23 : 59 : 59 is one second before midnight. If the ride spans midnight, the end time is smaller than the start time.

Output

Print the number of seconds between the two times on one line. No ride lasts 24 hours or longer. If the end time is smaller than the start time, the ride crossed midnight once. If the two times are equal, print 0.