#abc243b. [abc243_b]Hit and Blow

[abc243_b]Hit and Blow

Problem Statement

You are given integer sequences, each of length NN: A=(A1,A2,dots,AN)A = (A_1, A_2, \\dots, A_N) and B=(B1,B2,dots,BN)B = (B_1, B_2, \\dots, B_N).
All elements of AA are different. All elements of BB are different, too.

Print the following two values.

  1. The number of integers contained in both AA and BB, appearing at the same position in the two sequences. In other words, the number of integers ii such that Ai=BiA_i = B_i.
  2. The number of integers contained in both AA and BB, appearing at different positions in the two sequences. In other words, the number of pairs of integers (i,j)(i, j) such that Ai=BjA_i = B_j and ineqji \\neq j.

Constraints

  • 1leqNleq10001 \\leq N \\leq 1000
  • 1leqAileq1091 \\leq A_i \\leq 10^9
  • 1leqBileq1091 \\leq B_i \\leq 10^9
  • A1,A2,dots,ANA_1, A_2, \\dots, A_N are all different.
  • B1,B2,dots,BNB_1, B_2, \\dots, B_N are all different.
  • All values in input are integers.

Input

Input is given from Standard Input in the following format:

NN A1A_1 A2A_2 dots\\dots ANA_N B1B_1 B2B_2 dots\\dots BNB_N

Output

Print the answers in two lines: the answer to1. in the first line, and the answer to2. in the second line.


Sample Input 1

4
1 3 5 2
2 3 1 4

Sample Output 1

1
2

There is one integer contained in both AA and BB, appearing at the same position in the two sequences: A2=B2=3A_2 = B_2 = 3.
There are two integers contained in both AA and BB, appearing at different positions in the two sequences: A1=B3=1A_1 = B_3 = 1 and A4=B1=2A_4 = B_1 = 2.


Sample Input 2

3
1 2 3
4 5 6

Sample Output 2

0
0

In both 1. and 2., no integer satisfies the condition.


Sample Input 3

7
4 8 1 7 9 5 6
3 5 1 7 8 2 6

Sample Output 3

3
2