#include<bits/stdc++.h>
using namespace std;
int map1[1005][1005] = {0};//0:可走 1:不可走
int visit[1005][1005] = {0};
int n,m,t,cnt = 0;
int sx,sy,tx,ty;
int xx=0,yy=0;
void dfs(int x,int y){
if(x==tx and y==ty){
cnt++;
return ;
}
else{
xx=x-1,yy=y;
if(map1[xx][yy]==0 and visit[xx][yy]==0 and xx>=1 and yy>=1 and xx<=n and yy<=m){
visit[xx][yy] = 1;
dfs(xx,yy);
visit[xx][yy] = 0;
}
xx=x;yy=y+1;
if(map1[xx][yy]==0 and visit[xx][yy]==0 and xx>=1 and yy>=1 and xx<=n and yy<=m){
visit[xx][yy] = 1;
dfs(xx,yy);
visit[xx][yy] = 0;
}
xx=x+1;yy=y;
if(map1[xx][yy]==0 and visit[xx][yy]==0 and xx>=1 and yy>=1 and xx<=n and yy<=m){
visit[xx][yy] = 1;
dfs(xx,yy);
visit[xx][yy] = 0;
}
xx=x;yy=y-1;
if(map1[xx][yy]==0 and visit[xx][yy]==0 and xx>=1 and yy>=1 and xx<=n and yy<=m){
visit[xx][yy] = 1;
dfs(xx,yy);
visit[xx][yy] = 0;
}
}
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>tx>>ty;
for(int i=1;i<=t;i++){
int x,y;
cin>>x>>y;
map1[x][y] = 1;
}
visit[sx][sy] = 1;
dfs(sx,sy);
cout<<cnt;
return 0;
}