{"raw_statement":[{"iden":"problem statement","content":"You are given integer sequences, each of length $N$: $A = (A_1, A_2, \\dots, A_N)$ and $B = (B_1, B_2, \\dots, B_N)$.  \nAll elements of $A$ are different. All elements of $B$ are different, too.\nPrint the following two values.\n\n1.  The number of integers contained in both $A$ and $B$, appearing at the same position in the two sequences. In other words, the number of integers $i$ such that $A_i = B_i$.\n2.  The number of integers contained in both $A$ and $B$, appearing at different positions in the two sequences. In other words, the number of pairs of integers $(i, j)$ such that $A_i = B_j$ and $i \\neq j$."},{"iden":"constraints","content":"*   $1 \\leq N \\leq 1000$\n*   $1 \\leq A_i \\leq 10^9$\n*   $1 \\leq B_i \\leq 10^9$\n*   $A_1, A_2, \\dots, A_N$ are all different.\n*   $B_1, B_2, \\dots, B_N$ are all different.\n*   All values in input are integers."},{"iden":"input","content":"Input is given from Standard Input in the following format:\n\n$N$\n$A_1$ $A_2$ $\\dots$ $A_N$\n$B_1$ $B_2$ $\\dots$ $B_N$"},{"iden":"sample input 1","content":"4\n1 3 5 2\n2 3 1 4"},{"iden":"sample output 1","content":"1\n2\n\nThere is one integer contained in both $A$ and $B$, appearing at the same position in the two sequences: $A_2 = B_2 = 3$.  \nThere are two integers contained in both $A$ and $B$, appearing at different positions in the two sequences: $A_1 = B_3 = 1$ and $A_4 = B_1 = 2$."},{"iden":"sample input 2","content":"3\n1 2 3\n4 5 6"},{"iden":"sample output 2","content":"0\n0\n\nIn both `1.` and `2.`, no integer satisfies the condition."},{"iden":"sample input 3","content":"7\n4 8 1 7 9 5 6\n3 5 1 7 8 2 6"},{"iden":"sample output 3","content":"3\n2"}],"translated_statement":null,"sample_group":[],"show_order":["default"],"formal_statement":null,"simple_statement":null,"has_page_source":true}