#include <cstdio>
using namespace std;
FILE *f,*g;
int dp[2100];
int ds[2100];
bool a[1010][1010];
int simona,i,j,n,x,y,k,dpi,dsi;

inline int tr1(int x,int y) {
return ( n-y+x);
}

inline int tr2(int x,int y) {
return (y+x-1);
}



int main() {
f=fopen("broscute.in","r");
g=fopen("broscute.out","w");

fscanf(f,"%d%d",&n,&k);

for (i=1;i<=k;i++) {
	fscanf(f,"%d%d",&x,&y);
	a[x][y]=true;
	dpi=tr1(x,y);
	dsi=tr2(x,y);
	dp[dpi]++;
	ds[dsi]++;
	}


simona=0;

for (i=1;i<=n;i++)
	for (j=1;j<=n;j++) {
		dpi=tr1(i,j);
		dsi=tr2(i,j);
		if (a[i][j]==true) {
			if (dp[dpi]>1 || ds[dsi]>1)
				simona++;
			}
		else {
			if (dp[dpi]>0 && ds[dsi]>0) 
				simona++;
			}
		}

fprintf(g,"%d",simona);

return 0;
}