import java.util.Scanner; public class No11 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w, h, n; long ans = 0; w = sc.nextInt(); h = sc.nextInt(); n = sc.nextInt(); int[] s = new int[n], k = new int[n]; boolean[][] po = new boolean[w][h]; for (int i = 0; i < n; i++) { s[i] = sc.nextInt() - 1; k[i] = sc.nextInt() - 1; po[s[i]][k[i]] = true; } for (int i = 0; i < n; i++) { for (int j = 0; j < h; j++) { if(!po[s[i]][j]){ ans++; po[s[i]][j] = true; } } for (int j = 0; j < w; j++) { if(!po[j][k[i]]){ ans++; po[j][k[i]] = true; } } } System.out.println(ans); } }