The station at the Simferopol railway terminal#4552

The station at the Simferopol railway terminal

1 second
64 megabytes
Medium

The clock tower at the railway station is a notable landmark and symbol of Simferopol. Located beside the tracks, it has welcomed visitors to the city since the 1950s. The tower is topped with a red five-pointed star rising meters above the city, and each of its four clock faces is over meters in diameter.

The clock "chimes" every minutes—specifically, whenever the minute hand is at , , , or minutes past the hour. Given a starting and ending moment in time, determine how many times the clock will "chime" during this interval (including both endpoints).

Input

Each moment is given by five integers: the year (1955 \leq \text{year} \leq 10^9), month (1 \leq \text{month} \leq 12), day (1 \leq \text{day} \leq 31), hour (0 \leq \text{hour} \leq 23), and minute (0 \leq \text{minute} \leq 59). Times are given in the -hour format. The first line contains the start time, the second line contains the end time. It is guaranteed that dates are valid and the start time is not later than the end time.

Output

Print the number of times the clock "chimes" during the specified interval, including the boundaries.

Examples

Example 1

Loading
Loading