#include<bits/stdc++.h>
using namespace std;
bool a[7][7]={0},vis[7][7];
int n,m,t,sx,sy,fx,fy;
long long cnt=0;
short dx[4]={0,0,1,-1};
short dy[4]={1,-1,0,0};
void dfs(int x,int y){
if(x>n or x<1 or y>m or y<1 or a[x][y]==1 or vis[x][y]==1){
return;
}
if(x==fx and y==fy){
cnt++;
return;
}
for(int i=0;i<4;i++){
int nx=x+dx[i],ny=y+dy[i];
vis[x][y]=1;
dfs(nx,ny);
vis[x][y]=0;
}
}
int main(){
ios::sync_with_stdio(false);
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++){
int b,c;
cin>>b>>c;
a[b+1][c+1]=1;
}
dfs(sx,sy);
cout<<cnt<<endl;
return 0;
}