Given two integer sequences, each of length N
: A = (A1, A 2, ..., AN)
and B = (B1, B2, ..., BN)
.
All A
elements are different. All B
elements are also different.
Print the following two values.
- The number of integers contained in both
A
and B
appearing in the same position in the two sequences. In other words, the number of integers i
numbers such that Ai = Bi
.
- The number of integers contained in both
A
and B
that appear at different positions in the two sequences. In other words, the number of pairs of integers (i, j)
numbers such that Ai = Bj
and i ≠ j
.
Input
The program receives three lines as input. The first line contains one number
N
(1 <= N <= 1000) - the number of numbers in the sequence. The second line contains numbers
A1, A2, ..., AN
, all numbers are different . The third line contains numbers
B1, B2, ..., BN
, all numbers various (1 <= A
i, B
i <= 10
9).
Imprint
Print the answer to the first question on the first line, and the answer to the second on the second line.
Examples
# |
Input |
Output |
1 |
4
1 3 5 2
2 3 1 4
|
1
2
|
2 |
3
1 2 3
4 5 6
|
0
0
|