#CCBCHBAHAI0000085. Đếm số giá trị phân biệt - miền 0..1000 (Count Distinct Values in the Range 0..1000)

    ID: 1003 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesWorking with numbers

Đếm số giá trị phân biệt - miền 0..1000 (Count Distinct Values in the Range 0..1000)

Count Distinct Values in the Range 0..1000

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1} with 0≤ai≤10000\le a_i\le1000, let

S={ai∣0≤i<n}.S=\{a_i\mid0\le i<n\}.

Compute the number of distinct values D=∣S∣D=|S|.

Input

The first line contains nn. The second line contains nn integers in [0,1000][0,1000].

Output

Print DD, the number of distinct values.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le 10, 0≤ai≤10000\le a_i\le 1000.

Subtask 2 (30 points): 1≤n≤50001\le n\le 5000, 0≤ai≤10000\le a_i\le 1000.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le 2\cdot 10^5, 0≤ai≤10000\le a_i\le 1000.

Example

Input

9
3 3 0 7 3 7 1000 0 5

Output

5

Explanation

The output follows directly from the mathematical definition above.