#include<bits/stdc++.h>
using namespace std;
const int N=10;
int sx,sy,fx,fy,cnt;
bool vis[N][N];
int n,m,t;
void dfs(int x,int y){
if(x==fx&&y==fy){
cnt++;
return;
}
if(x<=0||x>n||y<=0||y>m)return;
if(vis[x][y])return;
vis[x][y]=1;
dfs(x+1,y);
dfs(x-1,y);
dfs(x,y+1);
dfs(x,y-1);
}
int main(){
cin>>n>>m>>t;
cin>>sx>>sy>>fx>>fy;
int x,y;
for(int i=1;i<=t;i++){
cin>>x>>y;
vis[x][y]=1;
}
dfs(sx,sy);
cout<<cnt<<endl;
return 0;
}