/* * To change this template, choose Tools | Templates * and open the template in the editor. */ /** * * @author cteam32 */ import java.io.IOException; /** * @author cteam32 */ public class ith { public static void main(String[] args) throws IOException { String input = nextLine(); String[] abn = input.split(" "); int a = Integer.valueOf(abn[0]); int b = Integer.valueOf(abn[1]); int n = abn.length == 3 ? Integer.valueOf(abn[2]) : 0; if (n == 0) { System.out.print(a * b); } else { boolean[][] pole = new boolean[a][b]; int i; int j; for (i = 0; i < pole.length; i++) { for (j = 0; j < pole[0].length; j++) { pole[i][j] = true; } } byte max = (byte) (a > b ? b : a); String[] abn2; for (int t = 0; t <= n; t++) { String input2 = nextLine(); abn2 = input2.split(" "); int x = Integer.valueOf(abn2[0]) - 1; int y = Integer.valueOf(abn2[1]) - 1; if (x > 0 && y > 0) { pole[x][y] = false; int k; for (k = 0; k < a; k++) { pole[k][y] = false; } for (k = 0; k < b; k++) { pole[x][k] = false; } for (k = -max; k < max; k++) { if (x + k < a && y + k < b && x + k > -1 && y + k > -1) { pole[x + k][y + k] = false; } if (x - k < a && y + k < b && x - k > -1 && y + k > -1) { pole[x - k][y + k] = false; } if (x + k < a && y - k < b && x + k > -1 && y - k > -1) { pole[x + k][y - k] = false; } if (x - k < a && y - k < b && x - k > -1 && y - k > -1) { pole[x - k][y - k] = false; } } } } int pocet = 0; for (i = 0; i < pole.length; i++) { for (j = 0; j < pole[0].length; j++) { if (pole[i][j]) { pocet++; } } } System.out.print(pocet); } } public static String nextLine() throws IOException { int z; String ret = ""; while ((z = ((char) (System.in.read()))) != '\n') { ret += (char) z; } return ret; } }