#include <bits/stdc++.h> using namespace std; int main() { int l,m; cin>>l>>m; vector<bool>tree(l+1,true); for(int i=0;i<m;i++) { int q,p; cin>>q>>p; for(int j=q;j<=p;j++) { tree[j]=false; } } int num=0; for(bool pan:tree) { if(pan) { num++; } } cout<<...