#include <bits/stdc++.h>
using namespace std;
int a[10][10],m,n,t,ans;
int sx,sy,fx,fy,tx,ty;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
void dfs(int x,int y){
if(x==fx and y==fy){
ans++;
return;
}
for(int i=0;i<=3;i++){
int nx,ny;
nx=x+dx[i],ny=y+dy[i];
if(nx>0 and nx<=m and ny>0 and ny<=n and a[nx][ny]==0){
a[nx][ny]=1;
dfs(nx,ny);
a[nx][ny]=0;
}
}
}
int main(){
cin>>m>>n>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++){
cin>>tx>>ty;
a[tx][ty]=1;
}
dfs(sx,sy);
cout<<ans;
return 0;
}