Every year at the ACM-ICPC World Finals a large chessboard is set up so the contestants can play against one another. In this problem we check your basic chess intuition.
Recall that a queen attacks along its row, its column, and both diagonals.
A chessboard already holds $i - 1$ queens. Your task is to count the squares on which the $i$-th queen could be placed so that it is not attacked by any of the queens already on the board. A candidate square must be empty and must not share a row, a column, or a diagonal with any existing queen.
The input consists of several tasks.
Each task begins with a line of three integers $X$, $Y$, $N$ separated by spaces. $X$ and $Y$ give the board size, with $1 \le X, Y \le 20,000$. $N = i - 1$ is the number of queens already placed, with $0 \le N \le X \cdot Y$.
The next $N$ lines each contain two integers $x_k$ and $y_k$ ($1 \le x_k \le X$, $1 \le y_k \le Y$), the position of the $k$-th queen. All positions are distinct, i.e. no two queens share the same square.
The last task is followed by a line containing three zeros, which is not processed.
For each task, print one line with a single integer: the number of empty squares that do not share a row, a column, or a diagonal with any queen already on the board.