n hikers stand in a line, each with a fitness score. Energy bars are handed out under two rules: every hiker receives at least 1 bar, and if a hiker's fitness score is strictly greater than an immediately adjacent hiker's score, that hiker must receive strictly more bars than that neighbor (hikers with equal scores have no ordering requirement between them). Find the minimum total number of bars that satisfies both rules for all hikers.
Input format
Line 1: an integer n.
Line 2: n space-separated integers, the hikers' fitness scores, in line order.
Output format
A single integer: the minimum total number of energy bars needed.
Constraints
- 1 <= n <= 40
- 1 <= score_i <= 100