A farmer has n trees in a row in his garden. He thinks, that a row of trees is beautiful if heights of trees in it are first increasing, then decreasing. For example, 2 5 6 3 is a beautiful row whereas 1 3 4 2 5 is not a beautiful row. The row of trees in farmers garden may not be beautiful. Help the farmer, cut down the minimum number of trees to make the row beautiful.
A row, sorted in increasing order and without any decreasing part is considered beautiful.
A row, sorted in decreasing order and without any increasing part is considered beautiful.
Input
The first line of input contains integer n.
The second line of input contains n space-separated integers - k1, k2, k3 ,...,kn.
Output
Print the value, representing the minimum number of trees you need to cut down to make a row beautiful.
Constraints
1 <= n <= 1000.
1 <= ki < 1000000.
Example#1
Input
8
3 17 4 12 5 6 2 1
Output
2
We can cut down 17 and 5.