#abc132b. [abc132_b]Ordinary Number
[abc132_b]Ordinary Number
Problem Statement
We have a permutation = {} of {}.
Print the number of elements () that satisfy the following condition:
- is the second smallest number among the three numbers , , and .
Constraints
- All values in input are integers.
- is a permutation of {}.
Input
Input is given from Standard Input in the following format:
Output
Print the number of elements () that satisfy the condition.
Sample Input 1
5
1 3 5 4 2
Sample Output 1
2
is the second smallest number among , , and . Also, is the second smallest number among , , and . These two elements satisfy the condition.
Sample Input 2
9
9 6 3 2 5 8 7 4 1
Sample Output 2
5