#t385. 登山
登山
Mountain Climbing
Problem Description
On May 1st, the ACM team organized a mountain-climbing trip. They found a mountain with scenic spots and decided to visit them in order, i.e. the index of each visited spot must be greater than that of the previously visited one. They also have another habit: they will not visit two spots at the same altitude consecutively, and once they start going downhill, they will not go up again. They want to visit as many spots as possible under these conditions. Can you find the maximum number of spots they can visit?
Input Format
First line: an integer — the number of spots.
Second line: integers — the altitude of each spot.
Output Format
The maximum number of spots that can be visited.
Sample Input
8
186 186 150 200 160 130 197 220
Sample Output
4