import std.stdio;

void main(){
	int a, b, n;
	while(readf("%d %d\n", &a, &b), a){
		int map[17][17];
		readf("%d\n", &n);
		while(n--){
			int x, y;
			readf("%d %d\n", &x, &y);
			map[y][x] = -1;
		}
		for(int i=1;i<=a;i++)map[1][i] = 1;
		for(int i=1;i<=b;i++)map[i][1] = 1;
		for(int i=2;i<=b;i++){
			for(int j=2;j<=a;j++){
				if(map[i][j] == -1)map[i][j] = 0;
				else map[i][j] = map[i-1][j] + map[i][j-1];
			}
		}
		writeln(map[b][a]);
	}
}