#include<iostream>
#include<cmath>
using namespace std;
int map[6][6] = { 0 }, T, sx, sy, fx, fy, n, m, ans = 0;
int dx[4] = { 1,-1,0,0 };
int dy[4] = { 0,0,1,-1 };
int hx[6][6] = { 0 };
void DFS(int x, int y)
{
if (map[x][y] == -1 || hx[x][y] == 1 || map[x][y] == 0)return;
if (x == fx && y == fy)
{
ans++;
return;
}
hx[x][y] = 1;
for (int i = 0; i < 4; i++)
{
DFS(x + dx[i], y + dy[i]);
hx[x + dx[i]][y + dy[i]] = 0;
}
return;
}
int main()
{
int x, y;
cin >> n >> m >> T;
cin >> sx >> sy >> fx >> fy;
for (int i = 1; i <= n; i++)
{
for (int j = 1; j <= m; j++)
{
map[i][j] = 1;
}
}
while (T--)
{
cin >> x >> y;
map[x][y] = -1;
}
DFS(sx, sy);
cout << ans << endl;
return 0;
}