{"raw_statement":[{"iden":"problem statement","content":"There is a grid with $H$ rows and $W$ columns. Let $(r, c)$ denote the square at the $r$\\-th row from the top and $c$\\-th column from the left.\nWe have $N$ pieces. For the $i$\\-th piece, we can choose to do one of the following:\n\n*   Put it at a square $(r, c)$ such that $A_i \\leq r \\leq C_i$ and $B_i \\leq c \\leq D_i$.\n*   Do not put it on the grid.\n\nHowever, we cannot put two pieces in the same row or the same column.\nAt most how many pieces can we put on the grid?"},{"iden":"constraints","content":"*   $1 \\leq H, W, N \\leq 100$\n*   $1 \\leq A_i \\leq C_i \\leq H$\n*   $1 \\leq B_i \\leq D_i \\leq W$\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$H$ $W$ $N$\n$A_1$ $B_1$ $C_1$ $D_1$\n$A_2$ $B_2$ $C_2$ $D_2$\n$\\vdots$\n$A_N$ $B_N$ $C_N$ $D_N$"},{"iden":"sample input 1","content":"2 3 3\n1 1 2 2\n1 2 2 3\n1 1 1 3"},{"iden":"sample output 1","content":"2\n\nBy putting the first piece at $(1, 1)$, the second piece at $(2, 2)$, and not putting the third piece on the grid, we can put two pieces on the grid. We cannot put three, so we should print $2$."},{"iden":"sample input 2","content":"5 5 3\n1 1 5 5\n1 1 4 4\n2 2 3 3"},{"iden":"sample output 2","content":"3"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}