The Stock Market DipEasy

The Stock Market Dip

Easy+10 XP · +5 Auraarraystraversalmin

Welcome to UptoSkills Arena! Rohan is a novice stock trader. He bought shares of a company on various days. He wants to know the day he should have sold his shares to minimize his loss, meaning, the day with the lowest price. Given a list of daily stock prices, find the lowest price Rohan could have achieved. If there are multiple days with the same lowest price, choose the earliest day.

Input

The first line contains an integer N, the number of days. The second line contains N space-separated integers representing the stock prices for each day.

Output

A single integer representing the index (0-based) of the day with the lowest stock price.

Constraints

1 <= N <= 1000. Stock prices are integers between -10^9 and 10^9.

Time limit 1 s (native code; slower languages get more)Memory 256 MB14 hidden tests

Example 1

Input
5
10 5 12 8 5
Output
1

The lowest price is 5, which occurs on day 1 and day 4. The earliest day is day 1 (0-based index).

Example 2

Input
3
100 200 300
Output
0

The lowest price is 100, occurring on day 0.

Hints