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

~/algor $ cat problems/saralash-har-xil-sonlar

Number of distinct values

Easy 1000 ms 128 MB 29%
Share

$n$ integers $a_{1}, a_{2}, \dots, a_{n}$ are given. Find how many distinct numbers there are among them.

Array cells: the first occurrence of each value is highlighted and they are counted

Input

The first line contains a positive integer $n$. The second line contains $n$ positive integers $a_{i}$ separated by spaces.

Output

One integer — the number of distinct numbers.

Note

$1 \le n \le 2 * 10^{5}$
$1 \le a_{i} \le 10^{9}$

Examples

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

Sign in to submit a solution

Signing up is free and takes a minute.