#include<bits/stdc++.h>
using namespace std;
int n,m,sx,sy,fx,fy,t,a[10][10],b[10][10];
int dx[]={0,1,-1,0},dy[]={1,0,-1,0};
long long ans=0;
void dfs(int x,int y){
//cout<<x<<" "<<y<<endl;
if(x==fx && y==fy){
++ans;
return;
}
for(int i=0;i<4;++i){
int xx=x+dx[i],yy=y+dy[i];
if(xx>=1 && xx<=n && yy>=1 && yy<=m && a[xx][yy]==0 && b[xx][yy]==0){
b[xx][yy]=1;
dfs(xx,yy);
b[xx][yy]=0;
}
}
}
int main(){
int x,y;
cin>>n>>m>>t>>sx>>sy>>fx>>fy;
while(t--){
cin>>x>>y;
a[x][y]=1;
}
a[sx][sy]=1;
dfs(sx,sy);
cout<<ans<<endl;
return 0;
}