import java.util.*; import java.math.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); long sum = 0; int[] W = new int[w]; int[] H = new int[h]; int uh = 0; int uw = 0; for(int i = 0; i < n; i++) { int s = sc.nextInt()-1; int k = sc.nextInt()-1; if(W[s] == 0) uw++; if(H[k] == 0) uh++; } System.out.println((long)w * h - (w - uw) * (h - uh) - n); } }