#C9989. Count Days With Increasing Steps

    ID: 54142 Type: Default 1000ms 256MiB

Count Days With Increasing Steps

Count Days With Increasing Steps

A hiker has recorded the number of steps he climbed over several days. Your task is to determine the number of days on which the hiker climbed strictly more steps than the previous day.

More formally, given an integer n representing the number of days and an array of integers a1, a2, …, an where ai is the number of steps climbed on the ith day, compute the value:

$$\text{answer} = \Big|\{ i \mid 2 \leq i \leq n,\; a_i > a_{i-1} \}\Big| $$

Note that if there is only one day or no days at all, the result is 0.

inputFormat

The first line contains an integer n (n (\ge) 0), indicating the number of days. The second line contains n space-separated integers, representing the number of steps climbed on each day in order.

outputFormat

Output a single integer representing the number of days during which the hiker climbed more steps than on the previous day.## sample

5
2 3 1 5 4
2