{"trustable":true,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eOn a two-dimensional plane, there are \u003cvar\u003e\\(N\\)\u003c/var\u003e red points and \u003cvar\u003e\\(N\\)\u003c/var\u003e blue points.\r\nThe coordinates of the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th red point are \u003cvar\u003e\\((a_i, b_i)\\)\u003c/var\u003e, and the coordinates of the \u003cvar\u003e\\(i\\)\u003c/var\u003e-th blue point are \u003cvar\u003e\\((c_i, d_i)\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003cp\u003eA red point and a blue point can form a \u003cem\u003efriendly pair\u003c/em\u003e when, the \u003cvar\u003e\\(x\\)\u003c/var\u003e-coordinate of the red point is smaller than that of the blue point, and the \u003cvar\u003e\\(y\\)\u003c/var\u003e-coordinate of the red point is also smaller than that of the blue point.\u003c/p\u003e\r\n\u003cp\u003eAt most how many friendly pairs can you form? Note that a point cannot belong to multiple pairs.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Constraints","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cul\u003e\r\n\u003cli\u003eAll input values are integers.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(1 \\leq N \\leq 100\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(0 \\leq a_i, b_i, c_i, d_i \u0026lt; 2N\\)\u003c/var\u003e\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(a_1, a_2, ..., a_N, c_1, c_2, ..., c_N\\)\u003c/var\u003e are all different.\u003c/li\u003e\r\n\u003cli\u003e\u003cvar\u003e\\(b_1, b_2, ..., b_N, d_1, d_2, ..., d_N\\)\u003c/var\u003e are all different.\u003c/li\u003e\r\n\u003c/ul\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Input","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003eInput is given from Standard Input in the following format:\u003c/p\u003e\r\n\u003cpre\u003e\u003cvar\u003e\\(N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_1\\)\u003c/var\u003e \u003cvar\u003e\\(b_1\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_2\\)\u003c/var\u003e \u003cvar\u003e\\(b_2\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(a_N\\)\u003c/var\u003e \u003cvar\u003e\\(b_N\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(c_1\\)\u003c/var\u003e \u003cvar\u003e\\(d_1\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(c_2\\)\u003c/var\u003e \u003cvar\u003e\\(d_2\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(:\\)\u003c/var\u003e\r\n\u003cvar\u003e\\(c_N\\)\u003c/var\u003e \u003cvar\u003e\\(d_N\\)\u003c/var\u003e\r\n\u003c/pre\u003e\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Output","value":{"format":"HTML","content":"\r\n\u003csection\u003e\r\n\u003cp\u003ePrint the maximum number of friendly pairs.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 1","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n2 0\r\n3 1\r\n1 3\r\n4 2\r\n0 4\r\n5 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eFor example, you can pair \u003cvar\u003e\\((2, 0)\\)\u003c/var\u003e and \u003cvar\u003e\\((4, 2)\\)\u003c/var\u003e, then \u003cvar\u003e\\((3, 1)\\)\u003c/var\u003e and \u003cvar\u003e\\((5, 5)\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 2","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\r\n0 0\r\n1 1\r\n5 2\r\n2 3\r\n3 4\r\n4 5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eFor example, you can pair \u003cvar\u003e\\((0, 0)\\)\u003c/var\u003e and \u003cvar\u003e\\((2, 3)\\)\u003c/var\u003e, then \u003cvar\u003e\\((1, 1)\\)\u003c/var\u003e and \u003cvar\u003e\\((3, 4)\\)\u003c/var\u003e.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 3","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e2\r\n2 2\r\n3 3\r\n0 0\r\n1 1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003cp\u003eIt is possible that no pair can be formed.\u003c/p\u003e\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 4","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n0 0\r\n7 3\r\n2 2\r\n4 8\r\n1 6\r\n8 5\r\n6 9\r\n5 4\r\n9 1\r\n3 7\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n"}},{"title":"Sample 5","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n0 0\r\n1 1\r\n5 5\r\n6 6\r\n7 7\r\n2 2\r\n3 3\r\n4 4\r\n8 8\r\n9 9\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e4\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n\r\n\u003csection\u003e\r\n\r\n\r\n\u003c/section\u003e\r\n\r\n\u003csection\u003e\r\n\u003c/section\u003e\r\n"}}]}