#K81437. Max Doors Opened

    ID: 35753 Type: Default 1000ms 256MiB

Max Doors Opened

Max Doors Opened

Given \(n\) doors and \(m\) keys, and a list of \(m\) integers where each integer represents the door a key can open, determine the maximum number of doors that can be opened. Each key can only be used once, and if multiple keys open the same door, that door is only counted once.

The answer is simply the number of distinct door numbers present in the list of keys.

inputFormat

The input is read from stdin. The first line contains two space-separated integers \(n\) and \(m\) representing the number of doors and the number of keys respectively. The second line contains \(m\) space-separated integers, with each integer indicating the door that a key can open. If \(m = 0\), the second line will be empty.

outputFormat

Print to stdout a single integer indicating the maximum number of doors that can be opened.

## sample
5 3
1 2 2
2