#include using namespace std; using ll=long long; using ull=unsigned long long; const ll MOD=1000000000+7; #define rep(I,N) for(int I=0;I; using vvec = vector>; ll lcm(ll a,ll b){ return a/__gcd(a,b)*b; } int main(){ int n,q; int sum=0; cin >> n >> q; vec ans; vec a(n,0); rep(i,q){ int l,r; cin >> l >> r; for(int i=l-1;i<=r-1;i++){ if(a[i]==0){ sum++; a[i]=1; }else{ sum--; a[i]=0; } } ans.push_back(sum); } for(auto i:ans)printf("%d\n",i); }