import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main_yukicoder11 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); Set hsw = new HashSet(); Set hsh = new HashSet(); for (int i = 0; i < n; i++) { int s = sc.nextInt(); int k = sc.nextInt(); hsw.add(s); hsh.add(k); } System.out.println((long)hsw.size() * h + hsh.size() * w - (long)hsw.size() * hsh.size() - n); sc.close(); } }