#C1591. Count Unique Words
Count Unique Words
Count Unique Words
You are given N sentences. Your task is to count the number of unique words across all sentences. A word is defined as a maximal sequence of alphanumeric characters. All punctuation characters should be ignored, and words should be compared in a case-insensitive manner. Formally, if you extract all words from the sentences, applying the transformation
\( word = to_lowercase(filter_{char \in word}(isalnum(char))) \)
then output the number of distinct words.
Example: For the input sentences "Hello, world!" and "Hello Universe. Universe, meet world.", the unique words are "hello", "world", "universe", and "meet", so the answer is 4.
inputFormat
The first line of input contains an integer N indicating the number of sentences. This is followed by N lines, each containing a sentence. Each sentence may contain letters, digits, spaces, and punctuation.
outputFormat
Output a single integer representing the count of unique words after converting all letters to lower case and ignoring punctuation.
## sample1
Hello, world!
2