Skip to main content
LIVE CONTEST: Round #7 · Begin Marathon is live now! …

~/algor $ cat problems/minmax/numbers-before-the-first-minimum

Numbers before the first minimum

Author Iqbolshoh Ilhomjonov 3 @iqbolshoh 650 problems
Easy 1000 ms 256 MB 26%
Share

A positive integer and integers are given. Find the number of elements before the first occurrence of the smallest element.

Counting the elements before the first minimum

Input

The first line contains an integer . The next line contains integers .

Output

One integer — the number of elements before the first minimum.

Note


Examples

Input #1
5
4 7 1 9 2
Output #1
2
Input #2
4
1 5 8 3
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.