{"raw_statement":[{"iden":"problem statement","content":"On a two-dimensional plane, there are $N$ red points and $N$ blue points. The coordinates of the $i$\\-th red point are $(a_i, b_i)$, and the coordinates of the $i$\\-th blue point are $(c_i, d_i)$.\nA red point and a blue point can form a _friendly pair_ when, the $x$\\-coordinate of the red point is smaller than that of the blue point, and the $y$\\-coordinate of the red point is also smaller than that of the blue point.\nAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs."},{"iden":"constraints","content":"*   All input values are integers.\n*   $1 \\leq N \\leq 100$\n*   $0 \\leq a_i, b_i, c_i, d_i < 2N$\n*   $a_1, a_2, ..., a_N, c_1, c_2, ..., c_N$ are all different.\n*   $b_1, b_2, ..., b_N, d_1, d_2, ..., d_N$ are all different."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$a_1$ $b_1$\n$a_2$ $b_2$\n$:$\n$a_N$ $b_N$\n$c_1$ $d_1$\n$c_2$ $d_2$\n$:$\n$c_N$ $d_N$"},{"iden":"sample input 1","content":"3\n2 0\n3 1\n1 3\n4 2\n0 4\n5 5"},{"iden":"sample output 1","content":"2\n\nFor example, you can pair $(2, 0)$ and $(4, 2)$, then $(3, 1)$ and $(5, 5)$."},{"iden":"sample input 2","content":"3\n0 0\n1 1\n5 2\n2 3\n3 4\n4 5"},{"iden":"sample output 2","content":"2\n\nFor example, you can pair $(0, 0)$ and $(2, 3)$, then $(1, 1)$ and $(3, 4)$."},{"iden":"sample input 3","content":"2\n2 2\n3 3\n0 0\n1 1"},{"iden":"sample output 3","content":"0\n\nIt is possible that no pair can be formed."},{"iden":"sample input 4","content":"5\n0 0\n7 3\n2 2\n4 8\n1 6\n8 5\n6 9\n5 4\n9 1\n3 7"},{"iden":"sample output 4","content":"5"},{"iden":"sample input 5","content":"5\n0 0\n1 1\n5 5\n6 6\n7 7\n2 2\n3 3\n4 4\n8 8\n9 9"},{"iden":"sample output 5","content":"4"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}