# Trees

Time Limit: 1000MS

Memory Limit: 65536K

## Input

There are several test cases in the input. Each case starts with an integer L (1 <= L < 2000000000) representing the length of the road and M (1 <= M <= 5000) representing the number of sections that are assigned for other use. The following M lines each describes a section. A line is in such format: Start End Here Start and End (0 <= Start <= End <= L) are both non-negative integers representing the start point and the end point of the section. It is confirmed that these sections do not overlap with each other. A case with L = 0 and M = 0 ends the input.

## Output

Output the number of trees left in one line for each test case.

## Sample Input

300 1
100 200
500 2
100 200
201 300
0 0


## Sample Output

200
300


## Source

Beijing 2005 Preliminary