#K49607. Longest Uniform Subsequence

    ID: 28680 Type: Default 1000ms 256MiB

Longest Uniform Subsequence

Longest Uniform Subsequence

You are given an array A of integers. Your task is to find the length of the longest subsequence in which all the elements are the same. In other words, determine the maximum frequency among all the integers in the array.

Mathematically, if \( \text{count}(x) \) denotes the number of occurrences of integer \( x \) in the array, then you need to compute:

[ \max_{x \in A} ; \text{count}(x) ]

Note that the subsequence does not need to be contiguous; it refers simply to a collection of elements from the array that are equal.

inputFormat

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

  1. The first line contains a single integer n denoting the number of elements in the array.
  2. The second line contains n space-separated integers representing the array elements.

outputFormat

Output to stdout a single integer, which is the length of the longest subsequence composed of identical numbers.

## sample
1
1
1