#include<bits/stdc++.h>
using namespace std;
const int N = 6;
bool map_[N][N], tmp[N][N];
int n, m, t, x, y, sx, sy, fx, fy, ans;
const int dx[4] = {0, 0, 1, -1};
const int dy[4] = {-1, 1, 0, 0};
void dfs(int x1, int y1){
if(x1 == fx && y1 == fy){
ans++;
return ;
}
for(int i = 0;i < 3;i++){
if(tmp[x1+dx[i]][y1+dy[i]] == 0 && map_[x1+dx[i]][y1+dy[i]] == 0 && x1+dx[i] >= 1 && x1+dx[i] <= n && y1+dy[i] >= 1 && y1+dy[i] <= m){
tmp[x1][y1] = 1;
dfs(x1+dx[i], y1+dy[i]);
tmp[x1][y1] = 0;
}
}
}
int main(){
cin >> n >> m >> t;
cin >> sx >> sy;
cin >> fx >> fy;
for(int i = 1;i <= t;i++){
cin >> x >> y;
map_[x][y] = 1;
}
tmp[sx][sy] = 1;
dfs(sx, sy);
cout << ans;
return 0;
}