Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/for-osishlar-soni

Number of increases

Easy 1000 ms 64 MB 30%
Share

A positive integer $n$ and $n$ integers $a_{1}, a_{2}, \dots, a_{n}$ are given. Find the number of elements of the sequence that are strictly greater than the previous one ($a_{i} \gt a_{i-1}$).

The number of rising steps in the sequence

Input

The first line contains $n$. The second line contains $n$ integers separated by spaces.

Output

One integer — the number of increases.

Note

$1 \le n \le 1000$
$-10^{9} \le a_{i} \le 10^{9}$

Examples

Input #1
6
1 3 2 5 5 6
Output #1
3
Input #2
3
5 4 3
Output #2
0

Sign in to submit a solution

Signing up is free and takes a minute.