#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue
#include <string>
int move1[5]={0,1,0,0,-1};
int move2[5]={0,0,1,-1,0};
int map[30][30];
int flag[30][30];
int ans=0;
int sx,sy,fx,fy;
int n,m,t;
using namespace std;
void dfs(int x,int y){
if(x==fx&&y==fy)
{
ans ++;
return ;
}
else {
for(int i=1;i<=4;i++)
{
int tx=x+move1[i];
int ty=y+move2[i];
if(tx<=n&&tx>=1&&ty<=m&&ty>=1&&flag[tx][ty]==0&&map[tx][ty]==0)
{
flag[tx][ty]=1;
dfs(tx,ty);
flag[tx][ty]=0;
}
}
}
}
int main(){
cin >> n>>m>>t;
cin >>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++)
{
int x,y;
cin >>x>>y;
map[x][y]=1;
}
dfs(sx,sy);
cout <<ans;
return 0;
}