#include<iostream>
using namespace std;
int n, m, ans=0;
int ex, ey; // 终点
int a[105][105]; // 地图数组
bool vis[105][105]; // 标记是否走过
int dx[4] = {0,1,0,-1};
int dy[4] = {1,0,-1,0};
void dfs(int x, int y){
// 递归到边界
if(x==ex&&y==ey){
ans++;
return;
}
// 搜索四个方向
for(int i=0;i<4;i++){
int xx = x + dx[i];
int yy = y + dy[i];
// 不能超过地图边界 走过的不能走 障碍不能走
if(xx>=1&&xx<=n&&yy>=1&&yy<=m&&vis[xx][yy]==0&&a[xx][yy]==0){
vis[xx][yy] = 1;
dfs(xx, yy);
vis[xx][yy] = 0;
}
}
}
int main(){
int t,sx,sy;
cin>>n>>m>>t;
// 输入起点、终点坐标
cin>>sx>>sy>>ex>>ey;
int x,y;
while(t--){
cin>>x>>y;
a[x][y] = 1;
}
vis[sx][sy] = 1;
dfs(sx,sy);
cout<<ans;
return 0;
}