# coding:UTF-8 import sys MOD = 10 ** 9 + 7 INF = float('inf') H, W, Q = list(map(int, input().split())) # スペース区切り連続数字 YX = [list(map(int, input().split())) for _ in range(Q)] # スペース区切り連続数字(行列) res = H * W zan = [H] * W for y, x in YX: t = y - 1 if zan[x-1] > t: d = zan[x-1] - t zan[x-1] = t res -= d print("{}".format(res))