#include <bits/stdc++.h>
using namespace std;
int xd[4]={0,-1,0,1},yd[4]={1,0,-1,0};
bool a[100][100];
int n,m,so;
int s=0;
int bx,by,ex,ey;
bool check(int x,int y){
return x>0&&y>0&&x<=m&&y<=n&&!a[x][y];
}
void dfs(int x,int y){
if(x==ex&&y==ey){
s++;
return;
}
for(int i=0;i<4;i++){
int xx=x+xd[i],yy=y+yd[i];
if(check(xx,yy)){
a[xx][yy]=true;
dfs(xx,yy);
a[xx][yy]=false;
}
}
}
int main(){
cin>>n>>m>>so;
cin>>bx>>by>>ex>>ey;
int q,p;
for(int i=0;i<so;i++){
cin>>q>>p;
a[q][p]=true;
}
dfs(bx,by);
cout<<s;
}
搜索小白www……