PROGRAMMING:Xiao Ming mends the chair
Xiao Ming was valued by his teacher for his excellent learning of C + +. One day, the teacher asked Xiao Ming to help solve a problem. The thing is, there is a row of n (1 < = n < = 10000) seats with bad chairs on the school playground. The bad chairs are very special because they are broken together. The sequence of chairs is 1, 2, 3... N. Now the repairman has an interval table of broken chairs. For example, the table records [a, b]; It means that the chairs a to B are all broken. Now I need your help to count the number of good chairs to facilitate the allocation of activity positions.
(hint: intervals may overlap)
###Input format:
Enter a number n, (0 = < n < = 10000) for the total number of chairs, and enter m (0 < = m < = 100) for the number of records on the repair order
The next M lines, each line [a, b], represent the interval of the bad chair.
###Output format:
The number of good chairs is: num
###Input example:
```in
10 2
[1,5]
[6,7]
```
###Output example:
```out
The number of good chairs is: 3
```
answer:If there is no answer, please comment
(hint: intervals may overlap)
###Input format:
Enter a number n, (0 = < n < = 10000) for the total number of chairs, and enter m (0 < = m < = 100) for the number of records on the repair order
The next M lines, each line [a, b], represent the interval of the bad chair.
###Output format:
The number of good chairs is: num
###Input example:
```in
10 2
[1,5]
[6,7]
```
###Output example:
```out
The number of good chairs is: 3
```
answer:If there is no answer, please comment