var
f:array[1..4,1..2]of longint;
a:array[1..1000,1..1000]of longint;
i,j,n,m,t,sx,sy,fx,fy,x,y,ans:longint;
function check(x,y:longint):boolean;
var i,j:longint;
begin
if (x>=1)and(x<=n)and(y>=1)and(y<=m)and(a[x,y]=0) then exit(true);
exit(false);
end;
procedure dfs(x,y:longint);
var i,j,xx,yy:longint;
begin
if (x=fx)and(y=fy) then begin inc(ans); exit; end;
for i:=1 to 4 do
if check(x+f[i,1],y+f[i,2]) then
begin
a[x+f[i,1],y+f[i,2]]:=1;
dfs(x+f[i,1],y+f[i,2]);
a[x+f[i,1],y+f[i,2]]:=0;
end;
end;
begin
f[1,1]:=1; f[1,2]:=0;
f[2,1]:=0; f[2,2]:=1;
f[3,1]:=-1; f[3,2]:=0;
f[4,1]:=0; f[4,2]:=-1;
readln(n,m,t);
readln(sx,sy,fx,fy);
for i:=1 to t do
begin
read(x,y);
a[x,y]:=1;
end;
if a[fx,fy]=i then begin write('0'); halt end;
a[sx,sy]:=-1;
dfs(sx,sy);
write(ans);
end.
f:array[1..4,1..2]of longint;
a:array[1..1000,1..1000]of longint;
i,j,n,m,t,sx,sy,fx,fy,x,y,ans:longint;
function check(x,y:longint):boolean;
var i,j:longint;
begin
if (x>=1)and(x<=n)and(y>=1)and(y<=m)and(a[x,y]=0) then exit(true);
exit(false);
end;
procedure dfs(x,y:longint);
var i,j,xx,yy:longint;
begin
if (x=fx)and(y=fy) then begin inc(ans); exit; end;
for i:=1 to 4 do
if check(x+f[i,1],y+f[i,2]) then
begin
a[x+f[i,1],y+f[i,2]]:=1;
dfs(x+f[i,1],y+f[i,2]);
a[x+f[i,1],y+f[i,2]]:=0;
end;
end;
begin
f[1,1]:=1; f[1,2]:=0;
f[2,1]:=0; f[2,2]:=1;
f[3,1]:=-1; f[3,2]:=0;
f[4,1]:=0; f[4,2]:=-1;
readln(n,m,t);
readln(sx,sy,fx,fy);
for i:=1 to t do
begin
read(x,y);
a[x,y]:=1;
end;
if a[fx,fy]=i then begin write('0'); halt end;
a[sx,sy]:=-1;
dfs(sx,sy);
write(ans);
end.