A seldom-known fact about email addresses is that you can format a given address in several different ways. In particular:
- The entire address is case-insensitive.
- Dots (
.) before the at-sign (
@) sign are ignored.
- A plus (
+) followed by any string can be added before the at-sign (
@). The plus and following string are ignored.
John runs a service where users sign up with their email address. He has noticed that some users have signed up multiple times using different representations of the same address. He has asked for your help to determine the number of unique email addresses that have signed up on his site.
The input will contain 10 datasets. Each dataset begins with a line containing an integer (), the number of email addresses. The next lines each contain an email address (). The email address will be formatted as a non-empty user part consisting of letters, numbers, dots, and pluses followed by a single at-sign followed by a non-empty domain part consisting of letters, numbers, and dots.
For the first 6 cases, .
For each dataset, output the number of unique email addresses in the dataset
Sample Input (Two Datasets Shown)
3 [email protected] [email protected] [email protected] 3 [email protected] [email protected] [email protected]
Educational Computing Organization of Ontario - statements, test data and other materials can be found at ecoocs.org