students stand in a row, and the music teacher asks
students to leave so that the remaining
students form a chorus formation.
The chorus formation refers to such a formation: Suppose the
students left are numbered
from left to right, and their heights are
respectively, then their heights satisfy
.
Your task is, given the heights of all
students, calculate the minimum number of students who need to leave, so that the remaining students can form a chorus formation.
Input Specification
The first line of the input consists of an integer
denoting the number of students. The second line consists of
integers separated by a single space denoting the height of the
-th student. The heights satisfy
.
Output Specification
Output the minimum number of students that should leave to form a chorus formation.
Sample Input
Copy
8
186 186 150 200 160 130 197 220
Sample Output
Copy
4
Constraints
For
of test cases,
.
For all test cases,
.
Comments