#include<bits/stdc++.h>
using namespace std;
int n, m, t, res = 0;
int sx,fx,sy,fy;
int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0};
int mymap[10][10] = {0};
void dfs(int x, int y)
{
if(x == fx && y == fy)
{
++res;
return;
}
for(int i=0;i<4;++i)
{
int a = x + dx[i], b = y + dy[i];
if(a >= 1 && a <= n && b >= 1 && b <= m && mymap[a][b] == 0)
{
mymap[a][b] = 1; // 防止走回头路
dfs(a, b);
mymap[a][b] = 0; // 回溯
}
}
return;
}
int main()
{
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
int a,b;
for(int i=0;i<t;++i)
{
cin>>a>>b;
mymap[a][b] = 1;
}
mymap[sx][sy] = 1;
dfs(sx, sy);
cout<<res;
return 0;
}