{"raw_statement":[{"iden":"problem statement","content":"There is a grid with $H$ rows and $W$ columns. Let $(i, j)$ denote the square at the $i$\\-th row from the top and $j$\\-th column from the left of the grid.  \nEach square of the grid is holed or not. There are exactly $N$ holed squares: $(a_1, b_1), (a_2, b_2), \\dots, (a_N, b_N)$.\nWhen the triple of positive integers $(i, j, n)$ satisfies the following condition, the square region whose top-left corner is $(i, j)$ and whose bottom-right corner is $(i + n - 1, j + n - 1)$ is called a **holeless square**.\n\n*   $i + n - 1 \\leq H$.\n*   $j + n - 1 \\leq W$.\n*   For every pair of non-negative integers $(k, l)$ such that $0 \\leq k \\leq n - 1, 0 \\leq l \\leq n - 1$, square $(i + k, j + l)$ is not holed.\n\nHow many holeless squares are in the grid?"},{"iden":"constraints","content":"*   $1 \\leq H, W \\leq 3000$\n*   $0 \\leq N \\leq \\min(H \\times W, 10^5)$\n*   $1 \\leq a_i \\leq H$\n*   $1 \\leq b_i \\leq W$\n*   All $(a_i, b_i)$ are pairwise different.\n*   All input values are integers."},{"iden":"input","content":"The input is given from Standard Input in the following format:\n\n$H$ $W$ $N$\n$a_1$ $b_1$\n$a_2$ $b_2$\n$\\vdots$\n$a_N$ $b_N$"},{"iden":"sample input 1","content":"2 3 1\n2 3"},{"iden":"sample output 1","content":"6\n\nThere are six holeless squares, listed below. For the first five, $n = 1$, and the top-left and bottom-right corners are the same square.\n\n*   The square region whose top-left and bottom-right corners are $(1, 1)$.\n*   The square region whose top-left and bottom-right corners are $(1, 2)$.\n*   The square region whose top-left and bottom-right corners are $(1, 3)$.\n*   The square region whose top-left and bottom-right corners are $(2, 1)$.\n*   The square region whose top-left and bottom-right corners are $(2, 2)$.\n*   The square region whose top-left corner is $(1, 1)$ and whose bottom-right corner is $(2, 2)$."},{"iden":"sample input 2","content":"3 2 6\n1 1\n1 2\n2 1\n2 2\n3 1\n3 2"},{"iden":"sample output 2","content":"0\n\nThere may be no holeless square."},{"iden":"sample input 3","content":"1 1 0"},{"iden":"sample output 3","content":"1\n\nThe whole grid may be a holeless square."},{"iden":"sample input 4","content":"3000 3000 0"},{"iden":"sample output 4","content":"9004500500"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}