A. Good Times
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A time of day is represented by three integers: hours, minutes, and seconds. A time is called good if one of these integers equals the sum of the other two.

Given two times on the same day in the 24-hour format, count the good times between them, including both endpoints.

Input

There is only one test case in each test file.

The first line contains three integers $$$h_1$$$, $$$m_1$$$, and $$$s_1$$$ ($$$0\le h_1\le23$$$, $$$0\le m_1,s_1\le59$$$), representing the hours, minutes, and seconds of the starting time, respectively.

The second line contains three integers $$$h_2$$$, $$$m_2$$$, and $$$s_2$$$ ($$$0\le h_2\le23$$$, $$$0\le m_2,s_2\le59$$$), representing the hours, minutes, and seconds of the ending time, respectively.

It is guaranteed that the starting time is no later than the ending time.

Output

Print one integer: the number of good times.

Examples
Input
0 2 0
0 3 0
Output
1
Input
1 45 46
1 46 45
Output
2
Input
23 36 59
23 36 59
Output
1
Note

In the first example, the only good time is $$$00{:}02{:}02$$$, since $$$0+2=2$$$, so the answer is $$$1$$$.

In the second example, the good times are $$$01{:}45{:}46$$$ and $$$01{:}46{:}45$$$, so the answer is $$$2$$$.