Under construction

Still being built. Things may change

Chairs

Interview

Time limit1sMemory limit512 MB

Summary
Given each person's entry and exit time on a single day, find the maximum number of people inside the library at any moment, counting entry and exit seconds as inside.
Level

Easy3 of 10

Topics
Sorting, Intervals, Implementation, Simulation
Solved
No attempts yet

Problem

To predict how many chairs the library of the Aglargond School of Magic needs, Ataranon, the school principal, ordered that the exact times each person enters and leaves the library be written down. Write a program that finds the greatest number of people inside the library at one moment, given that N people in total entered the library. Every person entered and left the library during one day. The second a person enters or leaves the library also counts as a second that person spent inside.

Input

The first line of input contains N (0 ≤ N ≤ 1000). The next N lines contain the hour, minute, and second of entry and the hour, minute, and second of exit, separated by one space. Times are given in the format HH:MM:SS, where HH is hours (00 ≤ HH ≤ 23), MM is minutes (00 ≤ MM ≤ 59), and SS is seconds (00 ≤ SS ≤ 59).

Output

Print exactly one line containing only the greatest number of people inside the library at one moment.

Hint

During the interval between 11:15:17 and 13:00:24 there were three people inside the library.

Examples1

  1. Example 1

    Input
    4
    08:00:00 10:00:11
    09:00:23 14:00:06
    11:00:52 13:00:24
    11:15:17 13:15:08
    
    Expected output
    3