The Head's Visitors#66

The Head's Visitors

1 second
128 megabytes
Very easy

The assistant at an educational institution, Anna Martin, begins each workday with a complaint to the head:

Help the assistant by organizing the schedule for the visitors based on their requested time intervals, as recorded in the assistant's book.

It is not allowed to receive two visitors at the same time. As soon as one meeting ends, the next can start immediately—their meetings may even overlap at the office door.

Input

The first line contains the number of visitors (n \le 1000) who have signed up for a meeting.

Each of the next lines contains two times: the meeting's start time T_{1i} and end time T_{2i} in the format hh:mm, separated by a space.

All times are within the same day and T_{2i} \ge T_{1i} for each .

Output

Print the maximum number of visitors who can be scheduled to meet with the head during the workday.

Examples

Example 1

Loading
Loading