Colorful Disk Threading is a game played with a base of vertical sticks and some paper disks with a hole in the center. The disks all have different radii and no two disks are the same color. When all the disks are stacked on top of each other, the number of colors that can be seen from above is the score in this game. So, disks that cannot be seen from above are not scored.
Given the radii of the disks in order from the bottom, write a program to calculate the score when all the disks are stacked. For example, if the stacking is as shown in the figure, the score will be 3.
The input is given in the following format.
$N$ $r_1$ $r_2$ ... $r_N$
The number of disks $N$ ($1 \leq N \leq 1,000$) is given in the first line, and the radius $r_i$ ($1 \leq r_i \leq N$) of each disk is given as an integer in the second line. The radii of the disks are all different ($r_i \ne r_j$ if $i \ne j$).
Output the scores on one line.
7 3 6 7 4 5 1 2
3
6 6 5 4 3 2 1
6