def main(): w, h, n = [int(input()) for i in range(3)] soot, no = [0] * w, [0] * h for i in range(n): s, k = map(int, input().split()) soot[s-1] = no[k-1] = 1 ans, used_no = 0, sum(no) for i in range(w): if soot[i]: ans += h else: ans += used_no print(ans-n) if __name__ == '__main__': main()