#include #include #include #include #include #include #include #include using namespace std; int main(){ int n,q; cin >> n >> q; vectorlamp(n,0); int count = 0; for(int i=0; i> start >> end; for(int j = start-1; j < end; j++){ if(lamp[j]){ lamp[j] = false; count--; }else{ lamp[j] = true; count++; } } cout << count << endl; } return 0; }