Game "Drunkard"#10248

Game "Drunkard"

1 second
256 megabytes
Easy

Vitalii and Bohdan have a total of cards, each uniquely numbered from to . Vitalii receives of these cards, while Bohdan gets the remaining cards.

They play a game called "Drunkard," where they shuffle their decks and draw the top card in each round. The player with the higher card value wins that round and scores a point. They continue playing until all cards have been used, resulting in rounds.

Your task is to determine the minimum and maximum number of points Vitalii can score.

Input

The first line contains a single integer (1 \le n \le 10^5), representing the number of cards each player holds.

The second line lists distinct integers a_1, a_2, \dots, a_n (1 \le a_i \le 2n), which are the values of Vitalii's cards.

Output

Output two integers: the minimum and maximum number of points Vitalii can score.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

Consider the first example where Vitalii's cards are , and Bohdan's cards are . Here are two possible outcomes:

  1. Vitalii plays , Bohdan plays . Bohdan scores because 1 < 6.

  2. Vitalii plays , Bohdan plays . Vitalii scores because 4 > 2.

  3. Vitalii plays , Bohdan plays . Vitalii scores because 5 > 3.

Vitalii scores two points.

In another scenario:

  1. Vitalii plays , Bohdan plays . Bohdan scores because 1 < 2.

  2. Vitalii plays , Bohdan plays . Bohdan scores because 4 < 6.

  3. Vitalii plays , Bohdan plays . Vitalii scores because 5 > 3.

Vitalii scores one point.

By examining all possible outcomes, it is evident that Vitalii cannot score fewer than one point or more than two points.

In the second example, Vitalii's cards are , and Bohdan's cards are . Here, every card Vitalii plays is greater than any card Bohdan plays, so Vitalii scores exactly points in every scenario.

Scoring

Solutions that correctly handle the constraints 1 \le n \le 2\,000 will earn of the total points.