{"raw_statement":[{"iden":"problem statement","content":"The season for Snuke Festival has come again this year. First of all, Ringo will perform a ritual to summon Snuke. For the ritual, he needs an altar, which consists of three parts, one in each of the three categories: upper, middle and lower.\nHe has $N$ parts for each of the three categories. The size of the $i$\\-th upper part is $A_i$, the size of the $i$\\-th middle part is $B_i$, and the size of the $i$\\-th lower part is $C_i$.\nTo build an altar, the size of the middle part must be strictly greater than that of the upper part, and the size of the lower part must be strictly greater than that of the middle part. On the other hand, any three parts that satisfy these conditions can be combined to form an altar.\nHow many different altars can Ringo build? Here, two altars are considered different when at least one of the three parts used is different."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 10^5$\n*   $1 \\leq A_i \\leq 10^9(1\\leq i\\leq N)$\n*   $1 \\leq B_i \\leq 10^9(1\\leq i\\leq N)$\n*   $1 \\leq C_i \\leq 10^9(1\\leq i\\leq N)$\n*   All input values are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $...$ $A_N$\n$B_1$ $...$ $B_N$\n$C_1$ $...$ $C_N$"},{"iden":"sample input 1","content":"2\n1 5\n2 4\n3 6"},{"iden":"sample output 1","content":"3\n\nThe following three altars can be built:\n\n*   Upper: $1$\\-st part, Middle: $1$\\-st part, Lower: $1$\\-st part\n*   Upper: $1$\\-st part, Middle: $1$\\-st part, Lower: $2$\\-nd part\n*   Upper: $1$\\-st part, Middle: $2$\\-nd part, Lower: $2$\\-nd part"},{"iden":"sample input 2","content":"3\n1 1 1\n2 2 2\n3 3 3"},{"iden":"sample output 2","content":"27"},{"iden":"sample input 3","content":"6\n3 14 159 2 6 53\n58 9 79 323 84 6\n2643 383 2 79 50 288"},{"iden":"sample output 3","content":"87"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}