Count Distinct ElementsEasy

Count Distinct Elements

EasyPractice library · +10 XPsortingcountingarrays

Given a list of N integers, you need to find out how many distinct (unique) integers are present in the list. Each distinct integer should be counted only once.

Input

The first line contains a single integer N. The second line contains N space-separated integers.

Output

Print a single integer, the count of distinct integers in the list.

Constraints

1 <= N <= 1000 -10^9 <= element <= 10^9

Time limit 1 s (native code; slower languages get more)Memory 256 MB13 hidden tests

Example 1

Input
5
1 2 2 3 1
Output
3

The distinct elements are 1, 2, and 3. Count is 3.

Example 2

Input
7
5 5 5 5 5 5 5
Output
1

All elements are the same. The only distinct element is 5. Count is 1.

Hints