import java.util.HashSet; import java.util.Scanner; public class Main { static boolean memo[]; static int ans, min; public static void main(String[] args) { Scanner sc = new Scanner(System.in); StringBuilder sb = new StringBuilder(); long w = sc.nextLong(); long h = sc.nextLong(); int n = sc.nextInt(); HashSet hs1 = new HashSet<>(); HashSet hs2 = new HashSet<>(); int mark, num; long sum; for (int i = 0; i < n; i++) { mark = sc.nextInt(); num = sc.nextInt(); hs1.add(mark); hs2.add(num); } sum = hs1.size() * h + (w - hs1.size()) * hs2.size() - n; System.out.println(sum); } }