import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { int w = sc.nextInt(); int h = sc.nextInt(); int n = sc.nextInt(); boolean[][] b = new boolean[w][h]; long ret = 0; for (int i = 0;i < n;i++) { int s = sc.nextInt()-1; int k = sc.nextInt()-1; for (int j = 0;j < h;j++) { if (!b[s][j]) { b[s][j] = true; ret++; } } for (int j = 0;j < w;j++) { if (!b[j][k]) { b[j][k] = true; ret++; } } } System.out.println(ret-n); } }