program exam;
const
w:array[1..4] of longint=(1,0,-1,0);
u:array[1..4] of longint=(0,1,0,-1);
var
b:array[1..10000,1..10000] of boolean;
m,n,sx,sy,fx,fy,s,t,i,p,q:longint;
procedure search(x,y:longint);
var
i1:longint;
begin
if (x>=fx) and (y>=fy) then
begin
inc(s);
exit;
end;
for i1:=1 to 4 do
if (0<x+u[i1]) and (x+u[i1]<=n) and (0<y+w[i1]) and (y+w[i1]<=m) and (b[x+u[i1],y+w[i1]]=false) then
begin
x:=x+u[i1];
y:=y+w[i1];
b[x,y]:=true;
search(x,y);
b[x,y]:=false;
x:=x-u[i1];
y:=y-w[i1];
end;
end;
begin
readln(n,m,t);
readln(sx,sy,fx,fy);
fillchar(b,sizeof(b),false);
for i:=1 to t do
begin
readln(p,q);
b[p,q]:=true;
end;
s:=0;
b[sx,sy]:=true;
search(sx,sy);
write(s);
end.