You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
7 lines
162 B
7 lines
162 B
5 months ago
|
a,b =map(int, input().split(' '))
|
||
|
nums=[]
|
||
|
for i in range(b):
|
||
|
m,n=map(int,input().split(' '))
|
||
|
nums.extend(range(m,n+1))
|
||
|
nums=set(nums)
|
||
|
print(a+1-len(nums))
|