#K83922. Maximum Frequency Difference

    ID: 36305 Type: Default 1000ms 256MiB

Maximum Frequency Difference

Maximum Frequency Difference

You are given an integer n and a list of n integers. For each distinct integer x in the list, let its frequency be denoted by \( f(x) \). Your task is to compute the maximum difference between the frequencies of any two distinct integers, i.e., compute \( \max(f(x)) - \min(f(x)) \).

If the list contains only one distinct integer, the answer is 0.

Example:

Input:
5
1 2 2 3 3

Output: 1

</p>

inputFormat

The first line contains an integer n representing the number of elements.

The second line contains n space-separated integers representing the list.

outputFormat

Output a single integer representing the maximum difference between the frequencies of any two distinct integers in the list.

## sample
1
1
0