The lonely M is again playing with his array a1,a2,...,an (as playing with his array is the only choice), he wants to choose a subsequence of array like b1,b2,...,bm that b1≥b2≤b3≥b4...≤(≥if m≡0 (mod 2))bm.
What is the maximum length of subsequence that M can choose which satisfies above condition?
Subsequence of an array can be obtained by erasing some (possibly zero) elements from the array. You can erase any elements, not necessarily going successively. The remaining elements preserve their order.
Input
First line contains only n, length of array.
Second line contains the array elements a1,a2,...,anseparated by space.
1≤n≤3×105
1≤ai≤3×105
Output
The only line of output contains an integer, the maximum length of subsequence that M can choose.
c can choose subseqence 5,4,19.