#!/usr/bin/env python3 #fileencoding: utf-8 W = int(input()) H = int(input()) N = int(input()) total = 0 marks = set([]) nums = set([]) for _ in range(N): s, k = [int(i) for i in input().strip().split(" ")] if s not in marks: total += (H - 1 - len(nums)) if k in nums: total += 1 marks.add(s) else: total -= 1 if k not in nums: total += (W - 1 - len(marks)) if s in marks: total += 1 nums.add(k) else: total -= 1 print(total)