#K54477. Maximum Character Frequency

    ID: 29762 Type: Default 1000ms 256MiB

Maximum Character Frequency

Maximum Character Frequency

Given an integer n and a string s of length n, your task is to compute the maximum frequency of any character in the string. In other words, determine the largest number of times any character appears in s.

You can use any appropriate algorithm to count the frequency of characters. A typical approach is to iterate through the string and use a frequency counter (such as a hash map) to keep track of each character's count, finally selecting the maximum value.

Note: The input will be given via stdin and the output should be printed to stdout.

inputFormat

The input consists of two lines:

  • The first line contains an integer n, representing the length of the string.
  • The second line contains the string s (of length n).

outputFormat

Output a single integer which is the maximum frequency of any character in the string s.

## sample
7
abacabad
4