import java.io.*; import java.util.*; public class Main { public static void main(String[] args) throws Exception { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int w = Integer.parseInt(br.readLine()); int h = Integer.parseInt(br.readLine()); int n = Integer.parseInt(br.readLine()); TreeMap s = new TreeMap(); TreeMap k = new TreeMap(); long count = 0; for (int i = 0; i < n; i++) { long tmpCount = 0; String[] tmp = br.readLine().split(" "); int[] tmpSk = new int[]{Integer.parseInt(tmp[0]), Integer.parseInt(tmp[1])}; if (!s.containsKey(tmpSk[0]) && !k.containsKey(tmpSk[1])) { tmpCount = w + h - 2 - s.size() - k.size(); s.put(tmpSk[0], 0); k.put(tmpSk[1], 0); } else if (s.containsKey(tmpSk[0])) { tmpCount = w - 2 - (s.size() - 1); k.put(tmpSk[1], 0); } else if (k.containsKey(tmpSk[1])) { tmpCount = h - 2 - (k.size() - 1); s.put(tmpSk[0], 0); } count += tmpCount; } System.out.println(count); } }