#include<bits/stdc++.h>
using namespace std;
int n,m,t,sx,sy,fx,fy,ans,a,b,bz[6][6];
void dfs(int x,int y)
{
if(x==fx and y==fy)
{
ans++;
return;
}
if(x>fx or y>fy)
return;
if(x<1 or y<1)
return;
if(x>n or y>m)
return;
bz[x][y]=1;
if(bz[x+1][y]==0)
{
bz[x+1][y]=1;
dfs(x+1,y);
bz[x+1][y]=0;
}
if(bz[x][y+1]==0)
{
bz[x][y+1]=1;
dfs(x,y+1);
bz[x][y+1]=0;
}
if(bz[x-1][y]==0)
{
bz[x-1][y]=1;
dfs(x-1,y);
bz[x-1][y]=0;
}
if(bz[x][y-1]==0)
{
bz[x][y-1]=1;
dfs(x,y-1);
bz[x][y-1]=0;
}
}
int main()
{
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
for(int i=1;i<=t;i++)
{
cin>>a>>b;
bz[a][b]=1;
}
bz[sx][sy]=1;
dfs(sx,sy);
cout<<ans;
return 0;
}