#C2370. Minimum Changes for Unique IDs

    ID: 45679 Type: Default 1000ms 256MiB

Minimum Changes for Unique IDs

Minimum Changes for Unique IDs

You are given an integer \( n \) and a list of \( n \) integers representing IDs. Some of these IDs may be repeated. In one operation, you can change an ID to any other integer that is not already present in the list. The goal is to make all the IDs unique by performing the minimum number of operations.

Example: For example, if \( n = 5 \) and the list of IDs is [1, 2, 2, 3, 3], you can change one of the duplicate '2's and one of the duplicate '3's, thus requiring 2 operations.

Your task is to compute and output the minimum number of operations required to achieve uniqueness.

inputFormat

The input consists of two lines:

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

outputFormat

Output a single integer denoting the minimum number of changes required to make all the IDs unique.

## sample
5
1 2 2 3 3
2

</p>