AT_past19_l 最長のジグザグ
Description
A length- $ k $ sequence $ A=(A_1,\ldots,A_k) $ is a zigzag sequence if:
- $ A_1 < A_2> A_3 < A_4 > \ldots $ , or
- $ A_1 > A_2 < A_3 > A_4
Input Format
The input is given from Standard Input in the following format:
> $ N $ $ B_1 $ $ \ldots $ $ B_N $
Output Format
Print the answer in one line.
Explanation/Hint
### Sample Explanation 1
The subsequence $ (5,2,4,3) $ of $ B $ is a zigzag sequence of length $ 4 $ .
### Constraints
- $ 1\leq N \leq 2 \times 10^5 $
- $ 1\leq B_i\leq 10^9 $
- All input values are integers.