CF599C Day at the Beach
Description
One day Squidward, Spongebob and Patrick decided to go to the beach. Unfortunately, the weather was bad, so the friends were unable to ride waves. However, they decided to spent their time building sand castles.
At the end of the day there were $ n $ castles built by friends. Castles are numbered from $ 1 $ to $ n $ , and the height of the $ i $ -th castle is equal to $ h_{i} $ . When friends were about to leave, Squidward noticed, that castles are not ordered by their height, and this looks ugly. Now friends are going to reorder the castles in a way to obtain that condition $ h_{i}
Input Format
The first line of the input contains a single integer $ n $ ( $ 1
Output Format
Print the maximum possible number of blocks in a valid partitioning.
Explanation/Hint
In the first sample the partitioning looks like that: \[1\]\[2\]\[3\].
In the second sample the partitioning is: \[2, 1\]\[3, 2\]
