#C9703. Coin Showcase Organization

    ID: 53826 Type: Default 1000ms 256MiB

Coin Showcase Organization

Coin Showcase Organization

You are given a collection of coins with various face values. The coins are to be arranged in a showcase with each row containing coins of the same value. Your task is to determine the minimum number of rows required to organize all the coins.

The answer is given by the number of unique coin values. Formally, if the list of coin values is denoted by \( coin\_values \), then the minimal number of rows required is:

$$minimum\_rows = \left| \{ v : v \in coin\_values \} \right| $$

For example, if you have 5 coins with values [1, 2, 2, 3, 3], then 3 rows are needed.

inputFormat

The input is read from standard input (stdin) and consists of two lines:

  • The first line contains a single integer \( n \) representing the number of coins.
  • The second line contains \( n \) space-separated integers representing the values of the coins.

Example:

5
1 2 2 3 3

outputFormat

Output a single integer to standard output (stdout) representing the minimum number of rows required. This value equals the number of unique coin values.

For instance, given the input above, the output should be:

3

Mathematically, it is computed as:

$$minimum\_rows = \left| \{ v : v \in coin\_values \} \right|$$## sample
5
1 2 2 3 3
3
$$