#include<bits/stdc++.h>
using namespace std;
int n,m,t;
int sx,sy,fx,fy;
int x[15],y[15];
int xy[15][15];
int ans;
int a[4]={0,0,-1,1};
int b[4]={-1,1,0,0};
bool judge(int x,int y){
if(x<1||x>n||y<1||y>m||xy[x][y]==1)return 1;
return 0;
}
void dfs(int x,int y){
if(x==fx&&y==fy){
ans++;
return;
}
for(int i=0;i<4;i++){
int xx=x+a[i];
int yy=y+b[i];
if(judge(xx,yy))continue;
xy[xx][yy]=1;
dfs(xx,yy);
}
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++){
cin>>x[i]>>y[i];
xy[x[i]][y[i]]=1;
}
xy[sx][sy]=1;
dfs(sx,sy);
cout<<ans;
return 0;
}