#include<bits/stdc++.h>
using namespace std;
long long ans,tx,ty,n,m,t,sx,sy,fx,fy;
bool ju[501][501]={0};
void find(int x,int y)
{
if(x==fx and y==fy)
{
ans++;
return;
}
if(ju[x+1][y]==0 and x+1<=n)
{
ju[x+1][y]=1;
find(x+1,y);
ju[x+1][y]=0;
}
if(ju[x-1][y]==0 and x-1>=1)
{
ju[x-1][y]=1;
find(x-1,y);
ju[x-1][y]=0;
}
if(ju[x][y+1]==0 and y+1<=m)
{
ju[x][y+1]=1;
find(x,y+1);
ju[x][y+1]=0;
}
if(ju[x][y-1]==0 and y-1>=1)
{
ju[x][y-1]=1;
find(x,y-1);
ju[x][y-1]=0;
}
}
int main()
{
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++)
{
cin>>tx>>ty;
ju[tx][ty]=1;
}
find(sx,sy);
cout<<ans;
return 0;
}