#include using namespace std; int main(){ long long L,N; cin>>L>>N; set S1[2]; set S2[2]; long long x,y; for(long long i=0;i>x>>y; x--,y--; S1[abs((y-x))%2].insert(y-x); S2[(x+y)%2].insert(x+y); } vector V[2]; long long ans = 0; for(long long i=0;i<2;i++){ for(auto a:S1[i]){ ans+=(long long)L-abs(a); V[i].push_back(a); } for(auto a:S2[i]){ long long x = L-abs((L-1)-a); ans+=(long long)x; ans-=upper_bound(V[i].begin(),V[i].end(),x-1)-lower_bound(V[i].begin(),V[i].end(),-(x-1)); } } cout<