/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.util.*; import java.io.*; /** * * @author cteam39 */ public class ith { static BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); static StringTokenizer st; static int rows, cols, n, d, r, s, rx, sx, freecount; static boolean[] xr, xs, drd, dld; static boolean free; //static boolean[][] obsazeno; public static void main(String[] args) throws Exception { while (true) { st = new StringTokenizer(br.readLine()); rows = Integer.parseInt(st.nextToken()); cols = Integer.parseInt(st.nextToken()); n = Integer.parseInt(st.nextToken()); if (rows == 0 && cols == 0 && n == 0) { break; } xr = new boolean[rows+1]; xs = new boolean[cols+1]; drd = new boolean[rows+cols]; dld = new boolean[rows+cols]; //obsazeno = new boolean[rows][cols]; for (int i = 0; i < n; i++) { st = new StringTokenizer(br.readLine()); r = Integer.parseInt(st.nextToken()); s = Integer.parseInt(st.nextToken()); xr[r] = true; xs[s] = true; drd[s-r+rows] = true; dld[cols-s-r+1+rows]=true; } freecount = 0; for (r = 1; r < rows+1; r++) { if(xr[r]) continue; for (s = 1; s < cols+1; s++) { if(xs[s]) continue; if(!drd[s-r+rows] && !dld[cols-s-r+1+rows]) freecount++; } } System.out.println(freecount); } } }