#include<bits/stdc++.h>
using namespace std;
bool a[6][6], b[6][6];
int c[4] = {0, 0, 1, -1};
int d[4] = {-1, 1, 0, 0};
int n, m, sx, sy, fx, fy, x, y, ans = 0, t;
void dfs(int x, int y) {
if (x == sx and y == fy) {
ans++;
return;
} else {
for (int i = 0; i <= 3; i++) {
int ex = x + c[i];
int ey = y + d[i];
if (ex >= 0 and ex<n and ey >= 0 and ey < m and b[ex][ey] == 0 && a[ex][ey] == 0) {
b[ex][ey] = 1;
dfs(ex, ey);
b[ex][ey] = 0;
}
}
}
}
int main() {
cin >> n >> m >> t;
cin >> sx >> sy >> fx >> fy;
sx -= 1, sy -= 1, fx -= 1, fy -= 1;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
a[i][j] = 0;
}
}
for (int i = 0; i < t; i++) {
int zx, zy;
cin >> zx >> zy;
a[zx - 1][zy - 1] = 1;
}
dfs(sx, sy);
cout << ans;
return 0;
}