You have a large garden with many plants. Each of those plants requires to be watered. You have been away for the weekend, so youβd like to water all the plants as quickly as possible. But as it takes time, youβve decided to water plants that have low humidity first.
Β
Everything in the garden is planted in a long row, so moving from one plant to its neighbor takes 1 minute, and watering one plant also takes 1 minute.
Knowing the humidity levels for each of the plants, youβre wondering how many minutes it would take to water all the plants. Youβre initially near the first plant.
Input
The first line of the input contains a single integer n (1 β€ n β€ ).
The next line contains n space-separated integers (1 β€ β€ n) the humidity levels for each plant.
Output
The program should print the number of minutes it would take you to water all the plants.