#include<bits/stdc++.h>
using namespace std;
int n,m,t,lh,ll,tot;
int sx,sy,fx,fy;
bool a[6][6];
int xx[5]={0,1,1,-1,-1};
int yy[5]={0,-1,1,1,-1};
void dfs(int h,int l){
if(h==fx&&l==fy){
tot++;
return;
}
for(int i=1;i<=4;i++){
if(a[h+xx[i]][l+yy[i]]||h+xx[i]>n||h+xx[i]<1||l+yy[i]>m||l+yy[i]<1) continue;
a[h][l]=true;
dfs(h+xx[i],l+yy[i]);
a[h][l]=false;
}
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++){
cin>>lh>>ll;
a[lh][ll]=true;
}
dfs(sx,sy);
cout<<tot;
return 0;
}