#include<bits/stdc++.h>
using namespace std;
int n,m,ans=0,sx,sy,fx,fy,t;
char a[105][105];
void work(int x,int y){
if (x==fx&&y==fy){
ans++;
return ;
}
if (a[x+1][y]!=1&&x+1<=m) a[x+1][y]=1,work(x+1,y);
if (a[x-1][y]!=1&&x-1>=0) a[x-1][y]=1,work(x-1,y);
if (a[x][y+1]!=1&&y+1<=n) a[x][y+1]=1,work(x,y+1);
if (a[x][y-1]!=1&&y-1>=0) a[x][y-1]=1,work(x,y-1);
}
int main(){
cin>>n>>m>>t>>sx>>sy>>fx>>fy;
for (int i=1;i<=t;i++){
int z1,z2;
cin>>z1>>z2;
a[z1][z2]=1;
}
work(sx,sy);
cout<<ans;
return 0;
}