#include<bits/stdc++.h>
bool a[10005][10005],vis[10005][10005];
int x1,y1,x2,y2,n,ans,m,t,j,i;
void dfs(int x,int y){
if(x==x2&&y==y2){
ans++;
return ;
}
else{
if(vis[x-1][y]==false){
vis[x-1][y]=true;
return dfs(x-1,y);
vis[x-1][y]=false;
}
if(vis[x+1][y]==false){
vis[x+1][y]=true;
return dfs(x+1,y);
vis[x+1][y]==false;
}
if(vis[x][y-1]==false){
vis[x][y-1]=true;
return dfs(x,y-1);
vis[x][y-1]=false;
}
if(vis[x][y+1]==false){
vis[x][y+1]=true;
return dfs(x,y+1);
vis[x][y+1]==false;
}
}
}
int main(){
cin>>n>>m>>t;
cin>>x1>>y1>>x2>>y2;
vis[x1][y1]=true;
for(i=0;i<t;i++){
int p,k;
cin>>p>>k;
vis[p][k]=-1;
}
dfs(x1,y1);
cout<<ans;
return 0;
}