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

~/algor $ cat problems/minmax-27-rekordlar-soni

Number of records

Easy 1000 ms 128 MB 33%
Share

A positive integer $N$ and $N$ integers are given. An element is called a record if it is strictly greater than all the elements before it; the first element is always a record. Find the number of records in the sequence.

Highlighting the record elements of a sequence

Input

The first line contains a positive integer $N$. The next line contains $N$ integers $A_{i}$.

Output

One integer — the number of records.

Note

$1 \le N \le 1000$
$-10^{9} \le A_{i} \le 10^{9}$

Examples

Input #1
7
3 1 5 5 2 8 6
Output #1
3
Input #2
3
4 4 4
Output #2
1

Sign in to submit a solution

Signing up is free and takes a minute.