#include <stdio.h>
#include <string.h>
int n,m,t,tx,ty;
int sx,sy,fx,fy,ans=0;
int wkx[4] = {-1 , 0 , 1 , 0};
int wky[4] = {0 , 1 , 0 , -1};
bool ctrl[6][6],vis[6][6];
void dfs(int x,int y);
int main(){
memset(ctrl,false,sizeof(ctrl));
memset(vis,false,sizeof(vis));
scanf("%d%d%d",&n,&m,&t);
scanf("%d%d%d%d",&sx,&sy,&fx,&fy);
for (int i=1;i<=t;i++){
scanf("%d%d",&tx,&ty);
ctrl[tx][ty] = true;
}
dfs(sx,sy);
printf("%d",ans);
return 0;
}
void dfs(int x,int y){
if (x >= fx and y >= fy){
ans++;
return;
}
for (int i=0;i<4;i++){
int a = x + wkx[i];
int b = y + wky[i];
if (a>=1 and b >=1 and a<=n and b <= m and !vis[a][b] and !ctrl[a][b]){
vis[a][b] = true;
dfs(a,b);
vis[a][b] = false;
}
}
}