#K92557. Unique Book Title Sections
Unique Book Title Sections
Unique Book Title Sections
In this problem, you are given n book titles. The task is to determine the smallest number of sections required to store these titles such that each section contains titles with distinct starting letters. In other words, if we define \( S \) as the set of first letters of the given titles, the answer is the size of \( S \), i.e., \( |S| \).
You need to read the input from standard input (stdin
) and output the result to standard output (stdout
).
inputFormat
The input consists of several lines. The first line contains a single integer n (1 ≤ n ≤ 105), representing the number of book titles. The following n lines each contain a non-empty string representing a book title. Each title is made up of uppercase letters.
outputFormat
Output a single integer representing the smallest number of sections required, which is equivalent to the number of distinct first letters in the given list of book titles.
## sample1
A
1