#abc152c. [abc152_c]Low Elements
[abc152_c]Low Elements
Problem Statement
Given is a permutation of . Find the number of integers that satisfy the following condition:
- For any integer , .
Constraints
- is a permutation of .
- All values in input are integers.
Input
Input is given from Standard Input in the following format:
Output
Print the number of integers that satisfy the condition.
Sample Input 1
5
4 2 5 1 3
Sample Output 1
3
, , and satisfy the condition, but does not - for example, holds for .
Similarly, does not satisfy the condition, either. Thus, there are three integers that satisfy the condition.
Sample Input 2
4
4 3 2 1
Sample Output 2
4
All integers satisfy the condition.
Sample Input 3
6
1 2 3 4 5 6
Sample Output 3
1
Only satisfies the condition.
Sample Input 4
8
5 7 4 2 6 8 1 3
Sample Output 4
4
Sample Input 5
1
1
Sample Output 5
1