#include<bits/stdc++.h>
using namespace std;
const int MAXN=10;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
bool vis[MAXN][MAXN];
int cnt=0;
int fx,fy,n,m;
void Dfs(int x,int y){
if(x==fx && y==fy){
cnt++;
return ;
}
vis[x][y] = true;
for(int i=0;i<4;i++){
int tx=x+dx[i];
int ty=y+dy[i];
if(tx>=1&&tx<=n and ty>=1&&ty<=m and !vis[tx][ty]){
Dfs(tx,ty);
}
vis[x][y] = false;
}
}
int main(){
int t;
cin>>n>>m>>t;
int sx,sy;cin>>sx>>sy>>fx>>fy;
for(int i=0;i<t;i++){
int a,b;cin>>a>>b;
vis[a][b]=1;
}
Dfs(sx,sy);
cout<<cnt;
return 0;
}