Stone Pairs
Alice and Bob have piles of stones numbered from to . In the -th merchant of stones. They perform the following process:
Alice chooses two non-empty piles. Let there are and stones in the piles, respectively.
Alice takes one stone from each of these piles.
Next, Bob also chooses two non-empty piles so that they also have and stones, respectively. That is, Bob chooses two piles so that they have the same number of stones as was originally in Alice's piles. Bob is allowed to choose the piles that Alice has chosen. If he can't do it, the process ends.
Bob also takes one stone from his chosen piles.
If the number of non-empty piles is less than , the described process ends, otherwise it is repeated from the beginning.
Note that Alice does not have to choose the same values of and each time.
Alice and Bob want to make sure there are as few stones as possible in the piles. Note that they have a common goal. Help them find the minimum number of stones that may remain.
Input
The first line contains two integers and (, ) — the number of piles and the group number.
The second line contains integers () — the number of stones in each pile.
Output
Print out one integer — the answer.
Examples
Note
In the first example, Alice can first select the first and third piles: and . After she picks up the stones, there will be stones in the piles, respectively.
Bob has to choose piles with and stones, so he will choose the second and first piles respectively. After he picks up the stones, there will be stones in the piles, respectively.
In the next step, Alice can choose, for example, the second and third piles: and . After she picks up the stones, there will be stones in the piles, respectively.
Bob will not be able to choose such piles that they have and stones, so the process ends. There are stones left.
Scoring
( points) ; ;
( points) is even; ;
( points) all are even;
( points)
( points) without additional restrictions.