PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#CC0000001. Đếm số giá trị khác nhau (Distinct Numbers)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đếm số giá trị khác nhau (Distinct Numbers)

Distinct Numbers

Source: CSES Version: Phuoc Hung OJ Extended

Problem Statement

You are given a sequence of integers. Some numbers may occur repeatedly. Determine how many different values appear; count each value only once.

Input

The first line contains NN. The next line contains NN integers a1,a2,…,aNa_1,a_2,\ldots,a_N.

Output

Print one integer: the count of distinct values.

Subtasks

  • Subtask 1 (20 points): 1≤N≤351\le N\le 35; 1≤ai≤1091\le a_i\le 10^9.
  • Subtask 2 (30 points): 1≤N≤25001\le N\le 2500; 1≤ai≤1091\le a_i\le 10^9.
  • Subtask 3 (50 points): 1≤N≤2⋅1051\le N\le 2\cdot 10^5; 1≤ai≤1091\le a_i\le 10^9.

Examples

Input

7
5 2 5 9 2 8 9

Output

4

Explanation

The four distinct values are 2,5,8,92,5,8,9.