import java.util.Arrays; import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args){ Scanner sc = new Scanner(System.in); final int W = sc.nextInt(); final int H = sc.nextInt(); final int N = sc.nextInt(); int[] counts = new int[W]; Set numbers = new HashSet(); for(int i = 0; i < N; i++){ final int S = sc.nextInt() - 1; final int K = sc.nextInt() - 1; counts[S]++; numbers.add(K); } long sum = (long)(W) * (long)(H); for(int i = 0; i < W; i++){ if(counts[i] == 0){ sum -= H - numbers.size(); }else{ sum -= counts[i]; } } System.out.println(sum); } }