Given a permutation
- If the maximum element it contains is
, then it contains all of the integers to
Input Specification
The first line will contain
The following line will contain
Output Specification
Output the number of subarrays with the described property.
Constraints
The given
Sample Input 1
Copy
1
1
Sample Output 1
Copy
1
Sample Input 2
Copy
2
2 1
Sample Output 2
Copy
2
Sample Input 3
Copy
3
1 3 2
Sample Output 3
Copy
2
Comments