A permutation is a sequence of integers from to of length containing each number exactly once. For example are permutations, and are not.
An array is called good if it can be converted to a permutation by applying the following operation any number of times (possibly zero):
For example, the arrays are good arrays while the arrays are not good.
You are given an array containing integers. Find the number of good subarrays of .
Input format
Output format
For each test case, print the answer in a separate line.
Constraints
In the first test case, the good subarrays are :
In the second test case, there are subarrays of . All subarrays except are good.