import sys input = sys.stdin.readline import bisect ODD_1=[] ODD_2=[] EVEN_1=[] EVEN_2=[] ANS=0 def calc1(x): if x=0: return N-x else: return N+x N,M=map(int,input().split()) for i in range(M): x,y=map(int,input().split()) x-=1 y-=1 if (x+y)%2==0: u=y+x v=x-y EVEN_1.append(u) EVEN_2.append(v) else: u=y+x v=x-y ODD_1.append(u) ODD_2.append(v) EVEN_1=sorted(set(sorted(EVEN_1))) EVEN_2=sorted(set(sorted(EVEN_2))) ODD_1=sorted(set(sorted(ODD_1))) ODD_2=sorted(set(sorted(ODD_2))) ANS=0 for x in ODD_1+EVEN_1: ANS+=calc1(x) for x in ODD_2+EVEN_2: ANS+=calc2(x) # ODD_1でx=Nと交わるのは、k=x-N+1として、ODD_2で-(x-2*k)<=x-2*k for x in ODD_1: if x