#000644

Rode

For many years now, inhabitants of a village called Navrhbrdovo have problems with storks. As we all know, with the spring come also the storks, bringing babies with them. The village of Navrhbrdovo is situated at the peak of a hill - a very tall one - so by the time they arrive, the storks get completely exhausted. Lately, they are employing lousy storks in "Baby Komerc" company and sometimes a stork drops a baby! To cope with such troublesome events, the villagers of Navrhbrdovo have installed radars on tops of their roofs so they can detect storks and watch them closely. But alas! The radars on some of the houses are interrupting some other radars which are placed on lower roofs to the right side of the house (storks always come from the right side of the village so all the radars are directed to the right).



Artisan Ivica has offered to install ProtivOmet-2011 (to nullify the interruptions) on all the roofs, and he will charge 1 KM for every pair of radars in conflict.



InputIn the first row there is a natural number N ( 1 \leq N \leq 1 000 000), the number of houses. In the next row there are N natural numbers, which are all \leq2\cdot10^{9}, representing the heights of the houses.


OutputIn the first and only row of the output, print the amount of money Ivica is about to earn followed by the currency symbol - KM.


Input
5
3 2 2 2 1

Output
7 KM


Input
5
1 2 3 4 5

Output
0 KM

Submit solution

Coming later

The grading service will be connected in a later migration step. You can inspect the task and your previous results now.