Problem Description
Gug has a random array A of length N. A subarray of A is defined as a slope if all its elements, when read from left to right, are in strictly ascending or strictly descending order.
Gug, for some reason, wants to cut A into smaller consecutive subarrays, such that each of these subarrays is a slope. Help him find the minimum number of cuts he has to make for this to happen.
Limits
For all tests: 1 ≤ Ai ≤ 109.
Subtask 1 (22%): 1 ≤ N ≤ 1000.
Subtask 2 (24%): 1 ≤ N ≤ 200000, 1 ≤ Ai ≤ 2.
Subtask 3 (26%): 1 ≤ N ≤ 200000, Ai ≠ Aj if i ≠ j.
Subtask 4 (28%): 1 ≤ N ≤ 200000.
Subtask 5 (0%): Sample Testcases.
Input
The first line of input will contain one integer, N.
The second line of input will contain N integers, representing the array A.
Output
The only line of output should contain one integer, the minimum number of cuts Gug has to make.
Sample Testcase 1
Input
5
9 5 3 2 1
Output
0
Sample Testcase 2
Input
5
1 2 3 2 1
Output
1
Sample Testcase 3
Input
6
1 2 3 3 2 1
Output
1