Reception at the Director's Office#272

Reception at the Director's Office

1 second
128 megabytes
Easy (≈1000)

The secretary of a general education institution began her workday with this remark to the director:

- Esteemed director, you have acquired a program for the scheduling of the deputy director's lessons. But what about me? I need to organize a schedule for the visitors according to your requirements, yet you have not purchased any program for me to plan administrative tasks...

Try to assist the secretary in this task. You need to organize the acceptance of visitors based on the requests they themselves have registered in the secretary's book.

Accepting two people at the same time is forbidden. The moment one visitor's meeting ends, another's may begin - they meet at the office door.

Input

The first line contains the number of visitors registered for a meeting, (n ≤ 1000). Each of the following lines contains two numbers - the start time s_i and the end time f_i of the meeting with the director in hh:mm format. The time is given within one day, and for all , the condition s_i\le f_i is met.

Output

Determine the maximum number of visitors that the director of the institution can receive in one working day.

Examples

Example 1

Loading
Loading