#include<bits/stdc++.h>
#define LL long long
using namespace std;
const int N = 1e3;
struct node{
int x,y;
bool operator<(const node& other) const {
if (x < other.x) {
return true;
} else if (x == other.x && y < other.y) {
return true;
}
return false;
}
};
set <node>s;
int n,m,t,dp[N][N];
signed main(){
ios::sync_with_stdio(0);
cin.tie(nullptr);
cin >> n >> m >> t;
while(t--){
int d,f;
cin >> d >> f;
node a;
a.x = d;
a.y = f;
s.insert(a);
}
for(int i = 1;i <= n;++i){
if(s.find({1,i}) == s.end()){
dp[1][i] = 1;
}
}
for(int i = 1;i <= m;++i){
if(s.find({i,1}) == s.end()){
dp[i][1] = 1;
}
}
for(int i = 1;i <= n;i++){
for(int j = 1;j <= m;j++){
if(i == 1 || j == 1){
continue;
}
if(s.find({i,j}) != s.end()){
continue;
}else{
dp[i][j] = dp[i - 1][j] + dp[i][j - 1];
}
}
}
cout << dp[n][m];
return 0;
}