#include using namespace std; using ll = long long; int main() { ll H, W, N; cin >> H >> W >> N; vector> dp(H + 1, vector(W + 1, 0)); vector> hole(H + 1, vector(W + 1, false)); for (int i = 0; i < N; i++) { ll h, w; cin >> h >> w; hole[h][w] = true; } ll ans = 0; for (int h = 1; h <= H; h++) { for (int w = 1; w <= W; w++) { if (hole[h][w]) continue; dp[h][w] = 1 + dp[h-1][w] + dp[h][w-1] - dp[h-1][w-1]; ans += dp[h][w]; } } cout << ans << endl; }