#P3418. Movie Festival

Movie Festival

当前没有测试数据。

Description

In a movie festival n movies will be shown. You know the starting and ending time of each movie. What is the maximum number of movies you can watch entirely?

Input Format

The first input line has an integer n: the number of movies.

After this, there are n lines that describe the movies. Each line has two integers a and b: the starting and ending times of a movie.

Output Format

Print one integer: the maximum number of movies.
3
3 5
4 9
2

Hint

<li> 1n2105 </li> <li> 1a<b109 </li>

Source

CSES