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.
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.
The program should print the number of minutes it would take you to water all the plants.