A. Yuyuan Market
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

In the bustling Yuyuan Market, young Li wants to buy jianzhi (traditional paper cuttings) from an artisan. The pieces are aligned in a row, each with a unique symbol, and Li can only purchase them in identical pairs following these rules:

  • If Li chooses a jianzhi at position $$$i$$$, he must immediately buy its pair at a position $$$j \gt i$$$.
  • After selecting a jianzhi, he cannot go back to buy an earlier one.

The price Li pays is the sum of the distances $$$j - i$$$ between all purchased pairs. Li wants to buy the maximum number of possible pairs in a single pass. Moreover, among all ways to achieve the maximum number of pairs, he wants to pay the minimum possible price. Help Li optimize his purchase.

Input

The first line contains an integer $$$N$$$ ($$$1 \leq N \leq 10^5$$$) — the number of symbols in the jianzhi row.

The following line contains $$$2N$$$ integers $$$A_i$$$ ($$$1 \leq A_i \leq N$$$) representing the symbols of the jianzhi in order. Each number between $$$1$$$ and $$$N$$$ appears exactly twice in the sequence.

Output

Print two space-separated integers: the maximum number of pairs Li can buy and the minimum possible price to buy that quantity.

Examples
Input
3
1 2 3 2 3 1
Output
1 2
Input
3
1 1 2 3 2 3
Output
2 3
Input
6
1 2 2 3 4 4 5 3 5 1 6 6
Output
4 5