#include <bits/stdc++.h>
using namespace std;
int n,m,t,sx,sy,fx,fy,x,y;
int cnt;
int dx[4] = {0,1,-1,0};
int dy[4] = {1,0,0,-1};
bool a[10][10];
void dfs(int xx,int yy) {
if(xx == fx && yy == fy){
cnt++;
return;
}
for(int i = 0; i < 4; i++){
int qx = xx + dx[i];
int qy = yy + dy[i];
if(a[qx][qy] == 0){
a[xx][yy] = 1;
dfs(qx,qy);
a[xx][yy] = 0;
}
}
}
int main()
{
cin >> n >> m >> t;
cin >> sx >> sy >> fx >> fy;
for(int i = 1; i <= t; i++){
cin >> x >> y;
a[x][y] = 1;
}
dfs(sx,sy);
return 0;
}