#include <iostream>
using namespace std;
int a[20][20];
int v[20][20];
int dx[4]={0,1,0,-1};
int dy[4]={1,0,-1,0};
int cnt=0;
void dfs(int sx,int sy,int fx,int fy)
{ if(sx==fx&&sy==fy)
{
cnt++;
return;
}
v[sx][sy]=1;
for(int k=0;k<=3;k++)
{
int tx,ty;
tx=sx+dx[k];
ty=sy+dy[k];
if(a[tx][ty]==1&&v[tx][ty]==0&&tx>=0&&ty>=0)
{
v[tx][ty]=1;
dfs(tx,ty,fx,fy);
v[tx][ty]=0;
}
if(tx==fx&&ty==fy) cnt++;
}
}
int main()
{ int n,m,t,sx,sy,fx,fy;
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
while(t--)
{
int ax,ay;
cin>>ax>>ay;
a[ax][ay]=2;
}
dfs(sx,sy,fx,fy);
cout<<cnt;
return 0;
}