import java.util.Arrays; import java.util.Scanner; public class Yukicoder11 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int W = sc.nextInt(); int H = sc.nextInt(); int N = sc.nextInt(); int[] mark = new int[W]; int[] num = new int[H]; long res = 0, count = 0; Arrays.fill(mark, 0); Arrays.fill(num, 0); for (int i = 0; i < N; i++) { mark[sc.nextInt() - 1]++; num[sc.nextInt() - 1]++; } for (int i = 0; i < W; i++) if (mark[i] > 0) { res += H - mark[i]; count++; } for (int i = 0; i < H; i++) if (num[i] > 0){ res += W - count; } System.out.println(res); } }