import java.math.BigInteger; import java.util.HashSet; import java.util.Scanner; import java.util.Set; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int W = scanner.nextInt(); int H = scanner.nextInt(); int N = scanner.nextInt(); Set Wsum = new HashSet<>(); Set Hsum = new HashSet<>(); for (int i = 0; i < N; i++) { int S = scanner.nextInt(); int K = scanner.nextInt(); Wsum.add(S); Hsum.add(K); } System.out.println(W * H - (W - Wsum.size()) * (H - Hsum.size()) - N); } }