{"raw_statement":[{"iden":"problem statement","content":"Given are three sequences of $N$ integers each: $A = (A_1, \\ldots, A_N),\\,B = (B_1, \\ldots, B_N),\\,C = (C_1, \\ldots, C_N)$.\nYou can permute each of these sequences in any way you like. Find the maximum possible number of indices $i$ such that $A_i < B_i < C_i$ after permuting them."},{"iden":"constraints","content":"*   $1\\leq N\\leq 10^5$\n*   $1\\leq A_i, B_i, C_i\\leq 10^9$"},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\ldots$ $A_N$\n$B_1$ $B_2$ $\\ldots$ $B_N$\n$C_1$ $C_2$ $\\ldots$ $C_N$"},{"iden":"sample input 1","content":"5\n9 6 14 1 8\n2 10 3 12 11\n15 13 5 7 4"},{"iden":"sample output 1","content":"3\n\nWe should permute them as follows:\n\n*   $A = (1,6,8,9,14)$,\n*   $B = (3,2,10,12,11)$,\n*   $C = (4,7,15,13,5)$.\n\nThen, we will have three indices $i$ ($i = 1, 3, 4$) such that $A_i < B_i < C_i$."},{"iden":"sample input 2","content":"1\n10\n20\n30"},{"iden":"sample output 2","content":"1"},{"iden":"sample input 3","content":"3\n1 1 1\n1 1 2\n2 2 2"},{"iden":"sample output 3","content":"0"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}