Given a list of N integers, find the number of different ranges (A to B inclusive) where the integers are all strictly ascending. The first number in the list will be considered as number 0. (0 ≤ A < B < N)
The first row will contain a single integer, N, denoting the number of numbers in the list.
The second row will contain N non-negative integers, of which all does not exceed 1 million.
A single integer denoting the number of different ranges of the list where the integers are all strictly ascending.
Subtask 1 (15%): N = 200
Subtask 2 (35%): N = 5000
Subtask 3 (50%): N = 100000
Subtask 4: Sample
Input:
10 1 2 3 4 4 5 6 7 8 9
Output:
21