1 /*Author:WNJXYK*/
2 #include<cstdio>
3 using namespace std;
4
5 const int Maxn=100;
6 int n,ks;
7 int map[Maxn+5][Maxn+5];
8 int ans[Maxn+5][Maxn+5];
9
10 inline void add(int x,int y,int val){
11 if (1<=x && x<=n && 1<=y && y<=n) ans[x][y]+=val;
12 }
13
14 int main(){
15 scanf("%d%d",&n,&ks);
16 for (int i=1;i<=ks;i++){
17 int x,y;
18 scanf("%d%d",&x,&y);
19 map[x][y]++;
20 }
21 for (int i=1;i<=n;i++){
22 for (int j=1;j<=n;j++){
23 if (map[i][j]){
24 ans[i][j]+=map[i][j];
25 for (int k=1;k<=n;k++){
26 add(i,j+k,map[i][j]);
27 add(i,j-k,map[i][j]);
28 add(i+k,j+k,map[i][j]);
29 add(i+k,j,map[i][j]);
30 add(i+k,j-k,map[i][j]);
31 add(i-k,j+k,map[i][j]);
32 add(i-k,j,map[i][j]);
33 add(i-k,j-k,map[i][j]);
34 }
35 }
36 }
37 }
38 int Ans=0;
39 for (int i=1;i<=n;i++){
40 for (int j=1;j<=n;j++){
41 if (ans[i][j]==ks) Ans++;
42 }
43 }
44 printf("%d\n",Ans);
45 return 0;
46 }