#include <bits/stdc++.h>
using namespace std;
const int dir[][2] = {0, 1, 1, 0, 0, -1, -1, 0};
struct point {
int x, y;
friend bool operator < (point a, point b) {
if (a.x == b.x) return a.y < b.y;
else return a.x < b.y;
}
};
int N, M, T, ans, sx, sy, ex, ey;
int vis[10][10];
void dfs(point cur) {
vis[cur.x][cur.y] = 1;
if (cur.x == ex && cur.y == ey) {
ans++;
return ;
}
for (int i = 0; i < 4; i++) {
int fx = cur.x + dir[i][0];
int fy = cur.y + dir[i][1];
if (fx < 1 || fy > N || fy < 1 || fy > M) continue;
if (vis[fx][fy] == -1 || vis[fx][fy] == 1) continue;
dfs({fx, fy});
}
return ;
}
int main() {
cin >> N >> M >> T >> sx >> sy >> ex >> ey;
while (T--) {
int x, y;
cin >> x >> y;
vis[x][y] = -1;
}
if (vis[N][M] == -1) {
cout << 0;
return 0;
}
dfs({sx, sy});
cout << ans;
return 0;
}
求助!玄关