#C11004. Longest Equal Subsequence

    ID: 40273 Type: Default 1000ms 256MiB

Longest Equal Subsequence

Longest Equal Subsequence

You are given a sequence of n integers. Your task is to determine the length of the longest subsequence in which all the elements are equal. More formally, given a sequence \(S = [s_1, s_2, \dots, s_n]\), let \(f(x)\) be the frequency of integer \(x\) in \(S\). The answer is \(\max_{x \in S} f(x)\). If the sequence is empty (i.e. \(n = 0\)), the answer is 0.

inputFormat

The input consists of two lines. The first line contains an integer \(n\) denoting the number of elements in the sequence. The second line contains \(n\) space-separated integers representing the sequence.

outputFormat

Output a single integer, the length of the longest subsequence where all elements are equal.

## sample
6
1 2 2 3 2 4
3