import java.io.*; import java.math.*; import java.util.*; public class Main { static int[] vy = {1,0,-1,0}; static int[] vx = {0,1,0,-1}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter out = new PrintWriter(System.out); int W = sc.nextInt(); int H = sc.nextInt(); int N = sc.nextInt(); int[] S = new int[N]; int[] K = new int[N]; for(int i = 0; i < N; i++) { S[i] = sc.nextInt(); K[i] = sc.nextInt(); } int[] s = new int[W+1]; int[] k = new int[H+1]; for(int i = 0; i < N; i++) { s[S[i]]++; k[K[i]]++; } long sum = 0; long uniqW = 0; long uniqH = 0; for(int i = 0; i <= W; i++) { if(s[i] != 0) { uniqW++; } } for(int i = 0; i <= H; i++) { if(k[i] != 0) { uniqH++; } } sum = H*uniqW + W*uniqH - uniqW*uniqH - N; System.out.println(sum); } }