Given a natural number
N
- the number of numbers that are input. A triple is any 3 numbers that are entered successively one after another. Determine the number of triples of numbers in which the second number from the triple is greater than the first and third numbers from the given triple.
Input
The first line contains a natural number
N
(N<10
5). The following
N
lines contain numbers, one per line. Each number does not exceed 10
9.
Imprint
Display one number on the screen - the answer to the problem.
Examples
# |
Input |
Output |
1 |
5
1
2
1
9
8 |
2 |
Запрещенные операторы:[