F. Finding Shelters
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

At Carnegie Mellon University, there are often many automatic water sprayers placed on campus to water the grass.

Unfortunately, SnowballSH often gets showered (or, as he often says, attacked) by these water sprayers while casually walking to class through a piece of grass referred to as "The Mall."

The Mall can be represented by an $$$m \times n$$$ rectangular grid, with $$$k$$$ of its cells containing an automatic water sprayer.

Each automatic water sprayer can be modeled to be continuously showering all cells in its row and all cells in its column.

A cell is called safe if and only if it is not showered by any automatic water sprayer.

Please help SnowballSH determine the number of safe cells on The Mall.

Input

The first line contains three integers $$$m$$$, $$$n$$$, and $$$k$$$ ($$$1 \le m \le 1500$$$, $$$1 \le n \le 1500$$$, $$$0 \le k \le mn$$$) — the number of rows, the number of columns, and the number of automatic water sprayers.

The $$$i$$$-th line of each of the following $$$k$$$ lines contains two integers $$$r_i$$$ and $$$c_i$$$ ($$$1 \le r_i \le m$$$, $$$1 \le c_i \le n$$$) — the row and column of the location of the $$$i$$$-th automatic water sprayer, respectively.

It is guaranteed that $$$(r_i, c_i) \ne (r_j, c_j)$$$ for all $$$i \ne j$$$.

Output

Output a single integer — the number of safe squares on the grid.

Examples
Input
6 7 5
2 2
3 3
2 5
6 7
5 5
Output
6
Input
1 100 1
1 67
Output
0
Input
15 135 0
Output
2025
Note

For the first test case, we have the following grid, where the circles represent cells with automatic water sprayers and blue diamonds represent safe cells:

There are six safe cells, so the answer is $$$6$$$.

For the second test case, there are no safe cells.

For the third test case, there are no automatic water sprayers, so all cells are safe.