#P6535. Count Frequent Initial Letters

    ID: 19748 Type: Default 1000ms 256MiB

Count Frequent Initial Letters

Count Frequent Initial Letters

Given \(n\) strings, each with a corresponding initial letter, you are to determine how many distinct initial letters are associated with at least \(5\) strings.

Input Format: The first line contains an integer \(n\) (\(n \ge 1\)), representing the number of strings. Each of the following \(n\) lines contains a non-empty string.

Output Format: Output a single integer: the number of distinct initial letters for which the count of strings is no less than \(5\).

inputFormat

The first line contains an integer (n). The next (n) lines each contain a non-empty string.

outputFormat

Output a single integer representing the number of initial letters that appear in at least 5 strings.

sample

7
apple
ant
ape
ball
bat
bear
arrow
0