#include<bits/stdc++.h>
#include<cmath>
using namespace std;
int i,j,k,xx,xxx,yy,yyy,cnt,m,n,ans,sum,q;
const int N = 6;
int a[N][N];
int xc[]={0,0,1,-1},yc[]={-1,1,0,0};
int tmp[N][N];
void dfs(int x,int y)
{
int tx,ty ;
if(tx==xxx&&ty==yyy)
{
sum++;
return;
}
else
{
for(q=0;q<4;q++)
{
tx=x+xc[q];
ty+=y+yc[q];
if(a[tx][ty]!=1&&1<=tx&&tx<=i&&1<=ty&&ty<=j&&tmp[tx][ty]!=1)
{
a[tx][ty]=1;
dfs(tx,ty);
a[tx][ty]=0;
}
}
}
}
int main()
{
ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
cin>>i>>j>>k;
cin>>xx>>yy>>xxx>>yyy;
for(cnt=1;cnt<=k;cnt++)
{
cin>>m>>n;
tmp[m][n]=1;
}
a[xx][yy]=1;
dfs(xx,yy);
cout<<sum;
return 0;
}