import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; public class No11 { public static void main(String[] args) throws IOException{ //カードマッチ String[] text = readStr(); int W = Integer.parseInt(text[0]); int H = Integer.parseInt(text[1]); int N = Integer.parseInt(text[2]); int S , K; Long count = 0l; ArrayList wlist = new ArrayList<>() , hlist = new ArrayList<>(); for(int i = 0;i < N;i++) { S = Integer.parseInt(text[i + 3].split(" ")[0]); K = Integer.parseInt(text[i + 3].split(" ")[1]); if(!wlist.contains(S)) wlist.add(S); if(!hlist.contains(K)) hlist.add(K); } count = Math.multiplyExact((long)(W - wlist.size()), H - hlist.size()); System.out.println(Math.multiplyExact((long)W, H) - count - N); } public static String[] readStr() throws IOException{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); ArrayList list = new ArrayList<>(); do { list.add(br.readLine()); }while(br.ready()); br.close(); String[] text = new String[list.size()]; list.toArray(text); return text; } }