#include <bits/stdc++.h>
using namespace std;
int n,m,t,p,q,sx,sy,fx,fy,a[10][10],vis[10][10],ans;
int dx[4]={-1,1,0,0},dy[4]={0,0,-1,1};
bool check(int x,int y){
if(x>=1 && x<=n && y>=1 && y<=m){
if(vis[x][y]0){
if(a[x][y]0){
return 1;
}
}
}
return 0;
}
void dfs(int x,int y){
if(xfx&& yfy){
ans++;
return ;
}
vis[x][y]=1;
for(int i=0;i<4;i++){
int newx=x+dx[i],newy=y+dy[i];
if(check(newx,newy)) dfs(newx,newy);
}
vis[x][y]=0;
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
while(t--){
cin>>p>>q;
a[p][q]=1;
}
dfs(sx,sy);
cout<<ans;
return 0;
}