Program figura;
var
v:array[-1..1000,-1..1000] of integer;
d,n,i,j,s,a,b,r,x,k:integer;
f1,f2:text;
begin
assign(f1,'figura.in');
assign(f2,'figura.out');
reset(f1);
rewrite(f2);
readln(d);
readln(n);
x:=0;

for k:=1 to n do begin
readln(a,b);
v[a,b]:=1;
end;

for i:=0 to d+1 do begin
for j:=0 to d+1 do begin
                    if v[i,j]=0 then begin
                    if (v[i-1,j]=1) then x:=x+1;
                    if (v[i+1,j]=1) then x:=x+1;
                    if (v[i,j-1]=1) then x:=x+1;
                    if (v[i,j+1]=1) then x:=x+1;
                                     end;
                   end;
                   end;
writeln(x);

close(f1);
close(f2);
end.
