Letter most

3.9

57 votes
Algorithms, String Manipulation
Problem

Lonely Y loves his string \(s\) of lowercase letters, Y is about to escape so he should choose just one lowercase letter \(c\) and carry all letters in \(s\) which is equal to \(c\) with himself.

What is the maximum number of letters Y can carry with himself?

Input

First line contains only \(n\), legnth of string \(s\).

Second line contains string \(s\) of lowercase letters.

\(1 \leq n \leq 10^5\)

Output

The only line of output contains an integer which is maximum number of letters that Y can carry.

Time Limit: 1
Memory Limit: 256
Source Limit:
Explanation

Y can choose \(r\) letter and carry \(2\) characters of \(s\).

Editor Image

?