/* * 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 int[][] 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 && N != 0) { str = new StringTokenizer(br.readLine()); RX = Integer.parseInt(str.nextToken()); RY = Integer.parseInt(str.nextToken()); N = Integer.parseInt(str.nextToken()); pole = new int[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] = 2; } for (int u = 0; u < pole[0].length; u++) { pole[y][u] = 2; } for (int u = 0; x - u >= 0 && y - u >= 0; u++) { pole[y - u][x - u] = 2; } for (int u = 0; x + u < pole[0].length && y + u < pole.length; u++) { pole[y + u][x + u] = 2; } for (int u = 0; y + u < pole.length && x - u >= 0; u++) { pole[y + u][x - u] = 2; } for (int u = 0; y - u >= 0 && x + u < pole[0].length; u++) { pole[y - u][x + u] = 2; } //// for(int u=0;u=0;u--){ //// if(u+max0){ //// pole[pole.length-uu+max]=2; //// } //// } // } int pocet = 0; for (int u = 0; u < pole.length; u++) { for (int v = 0; v < pole[0].length; v++) { if (pole[u][v] == 0) { pocet++; } } } if (RX != 0 && RY != 0) { System.out.println(pocet); } } } }