#include<bits/stdc++.h>
using namespace std;
int f[100][100],za[100][100],book[100][100]={0};
int n,m,t,a,b,sum;
int sx,sy,fx,fy;
int vx[5]={0,1,0,-1,0};
int vy[5]={0,0,1,0,-1};
int dfs(int k,int h){
if(k==fx&&h==fy){
sum++;
}
if(book[k][h]==0&&za[k][h]==0&&k>=1&&k<=n&&h>=1&&h<=m)
for(int i=1;i<=4;i++){
book[k][h]=1;
int tx,ty;
tx=k+vx[i];
ty=h+vy[i];
dfs(tx,ty);
book[k][h]=0;
}
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++){
cin>>a>>b;
za[a][b]=1;
}
book[fx][fy]=1;
dfs(sx,sy);
cout<<sum;
}