#include <iostream>
using namespace std;
int N, M, T;
int sx, sy, fx, fy;
bool arr[6][6] = {0};
int ans = 0;
void dfs(int x, int y)
{
if (arr[x][y] == 0)
{
return;
}
if (x == fx && y == fy)
{
ans++;
return;
}
else
{
arr[x][y] = 0;
dfs(x + 1, y);
dfs(x, y + 1);
dfs(x - 1, y);
dfs(x, y - 1);
arr[x][y] = 1;
}
}
int main()
{
cin >> N >> M >> T;
cin >> sx >> sy >> fx >> fy;
sx += 1;
sy += 1;
fx += 1;
fy += 1;
for (int i = 2; i < N + 2; i++)
{
for (int j = 2; j < M + 2; j++)
{
arr[i][j] = 1;
}
}
for (int i = 0; i < T; i++)
{
int x, y;
cin >> x >> y;
x += 1;
y += 1;
arr[x][y] = 0;
}
if (arr[fx][fy] == 0)
{
cout << 0;
return 0;
}
dfs(sx, sy);
cout << ans;
return 0;
}