/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.IOException; import java.io.InputStreamReader; import java.io.BufferedReader; import java.util.StringTokenizer; /** * * @author cteam05 */ public class ith { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer str; static boolean[][] pole; static int RX = 1, RY = 1, x = 1, y = 1, N = 1; /** * @param args the command line arguments */ public static void main(String[] args) throws IOException { while (RX != 0 && RY != 0) { str = new StringTokenizer(br.readLine()); RX = Integer.parseInt(str.nextToken()); RY = Integer.parseInt(str.nextToken()); N = Integer.parseInt(str.nextToken()); pole = new boolean[RY][RX]; for (int k = 0; k < N; k++) { str = new StringTokenizer(br.readLine()); x = Integer.parseInt(str.nextToken()) - 1; y = Integer.parseInt(str.nextToken()) - 1; //pole[y][x] = 1; for (int u = 0; u < pole.length; u++) { pole[u][x] = true; } for (int u = 0; u < pole[0].length; u++) { pole[y][u] = true; } for (int u = 0; (x - u) >= 0 && (y - u) >= 0; u++) { pole[y - u][x - u] = true; } for (int u = 0; (x + u) < pole[0].length && (y + u) < pole.length; u++) { pole[y + u][x + u] = true; } for (int u = 0; (y + u) < pole.length && (x - u) >= 0; u++) { pole[y + u][x - u] = true; } for (int u = 0; (y - u) >= 0 && (x + u) < pole[0].length; u++) { pole[y - u][x + u] = true; } // for (int i = 0; i < pole.length; i++) { // for (int j = 0; j < pole[0].length; j++) { // System.out.print(pole[i][j]); // } // System.out.println(); // } } int pocet = 0; for (int u = 0; u < pole.length; u++) { for (int v = 0; v < pole[0].length; v++) { if (pole[u][v] == false) { pocet++; } } } if (RX != 0 && RY != 0) { System.out.println(pocet); } } } }