The first line of the input contains an integer $n$ from $1$ to $1000$: the number of runners.

The second line contains $n$ space-delimited integers $a_1, a_2, \ldots, a_n$, where $a_i$ is the number of upsets performed by runner $i$.

The given data is consistent with some possible results of the competition: for every $i$, it is true that $a_i \le n - i$.
In particular, $a_n = 0$.