Run ID:86247

提交时间:2024-07-23 19:55:41

l,m = map(int,input().split()) street = [1 for x in range(l+1)] for i in range(m): s,f = map(int,input().split()) street = street[:s]+[0 for x in range(f-s+1)]+street[f+1:] print(sum(street))