#include <bits/stdc++.h>
using namespace std;
int n, m, t, sx, sy, fx, fy, xx, yy, ans;
bool a[10][10], bo[10][10];
bool check(int aa, int b) {
if (aa >= 1 && aa <= n && b >= 1 && b <= m && a[aa][b] == 0 && !bo[aa][b]) {
return 0;
}
return 1;
}
void dfs(int x, int y) {
if (check(x, y) == 1) {
return;
}
bo[x][y] = 1;
if (x == fx && y == fy) {
ans++;
return;
}
dfs(x + 1, y);
dfs(x - 1, y);
dfs(x, y + 1);
dfs(x, y - 1);
bo[x][y] = 0;
}
int main() {
cin >> n >> m >> t;
cin >> sx >> sy >> fx >> fy;
while (t--) {
cin >> xx >> yy;
a[xx][yy] = 1;
}
dfs(sx, sy);
cout << ans;
return 0;
}