PROGRAMMING:watch movie
Finally, it's the weekend. I like watching movies very much. He wants to see as many complete films as possible in a day.
Now he gives you the schedule of his favorite movie. I hope you can help him arrange it reasonably.
###Input format:
The input contains multiple sets of test data. The first line of each group is an integer n (n < = 100), which indicates the total number of movies that you like.
In the next N lines, enter two integers Si and EI (1 < = I < = n) for each line to represent the start and end time of the ith movie. In order to simplify the problem, each time is represented by a positive integer.
When n = 0, the input ends.
###Output format:
For each group of input, output the number of movies that can be seen completely.
###Input example:
Here is a set of inputs. For example:
```in
twelve
1 3
3 4
0 7
3 8
15 19
15 20
10 15
8 18
6 12
5 10
4 14
2 9
0
```
###Output example:
The corresponding output is given here. For example:
```out
five
```
answer:If there is no answer, please comment
Now he gives you the schedule of his favorite movie. I hope you can help him arrange it reasonably.
###Input format:
The input contains multiple sets of test data. The first line of each group is an integer n (n < = 100), which indicates the total number of movies that you like.
In the next N lines, enter two integers Si and EI (1 < = I < = n) for each line to represent the start and end time of the ith movie. In order to simplify the problem, each time is represented by a positive integer.
When n = 0, the input ends.
###Output format:
For each group of input, output the number of movies that can be seen completely.
###Input example:
Here is a set of inputs. For example:
```in
twelve
1 3
3 4
0 7
3 8
15 19
15 20
10 15
8 18
6 12
5 10
4 14
2 9
0
```
###Output example:
The corresponding output is given here. For example:
```out
five
```
answer:If there is no answer, please comment