G. Sleep
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

Veronica is a very light sleeper and reacts to every sound. Ira watches how Veronica sleeps very carefully. She keeps a diary and records how Veronica sleeps. In a few months, there were a lot of entries in the diary, as many as $$$n$$$ pieces. Each entry in the diary looks like this: $$$hh_1:mm_1:ss_1$$$ – the time when Veronica fell asleep, and $$$hh_2:mm_2:ss_2$$$ – the time when Veronica woke up.

Once the neighbor from above started drilling, making repairs, Veronica woke up from this sound and was very scared, and Veronica cried for a long time. Igor didn't like that his daughter was scared by new sounds. Igor went to deal with a neighbor. When he came to him, he explained the situation politely and showed the diary, explaining that it was highly undesirable to carry out repairs during Veronica's sleeping intervals recorded in the diary; otherwise, Igor would come to the neighbor again to solve this issue.

Help calculate how much time in seconds the neighbor has for repairs each day.

Input

In the first line, one given integer number $$$n$$$ $$$(1\leq n\leq 10^5)$$$ is the number of sleeping intervals in Igor's diary.

Further in each line is given time of Veronika's sleep separated by spaces $$$hh_1:mm_1:ss_1$$$, $$$hh_2:mm_2:ss_2$$$ $$$(0\leq hh_1,hh_2\leq 23,0\leq mm_1,mm_2\leq 59,0\leq ss_1,ss_2\leq 59)$$$ – time of falling asleep and time of waking up.

Each Veronica's sleeping interval is guaranteed to be less than $$$24$$$ hours.

Output

In one line, output the number of seconds for the neighbor's repairs.

Examples
Input
5
13:00:00 14:00:00
16:00:00 17:00:00
19:00:00 20:00:00
01:00:00 05:00:00
04:00:00 05:00:00
Output
61200
Input
4
22:49:13 05:22:28
18:50:30 14:32:25
11:34:33 11:28:25
08:55:57 19:49:53
Output
0
Input
2
10:48:15 07:42:04
03:00:33 04:52:08
Output
11171