D - Database of Clients

Time limit: 3 seconds
Memory limit: 256 megabytes
Languages: MS C# .NET 4.7.2053,GNU G++11 5.1.0 ...

Nowadays there are billions of email users. A little-known fact is that some email providers offer way more than the usual $\texttt{username@provider.com}$ email address.

Some providers simply ignore dots in usernames. Thus, if John owns the username $\texttt{johnsmith}$, he could tell people that his email address is $\texttt{johnsmith@provider.com}$, $\texttt{john.smith@provider.com}$ or $\texttt{john.s.mith@provider.com}$, among others. Emails sent to any of these addresses would end up on his mailbox.

Other providers allow appending the character $\texttt{+}$ followed by any combination of letters and/or digits after the username. With this feature, by registering the username $\texttt{johnsmith}$, John would also be able to use $\texttt{johnsmith+friends@provider.com}$ and $\texttt{johnsmith+2x3is6@provider.com}$.

Sometimes both features are available at once and in those cases $\texttt{john.smith+icpc@provider.com}$ and $\texttt{john.smith+wants.2.eat.lemon.3.14@provider.com}$ are valid addresses that John could use.

This is quite useful for users, who can manage different addresses to help organize their mailboxes and easily filter the newsletters eventually sent after registering on a new website. Unfortunately, this also opens up space for abuse. Some websites rely upon the fact that each email address identifies a single user. However, a misbehaving user might easily create multiple accounts by taking advantage of the multiple addresses allowed by the email provider.

After learning all of this your boss got really worried. What if the number of unique users that has been reported to the shareholders is not accurate, bloated by duplicate accounts instead? That brings you to the task at hand: given the list of all email addresses from the users database of the company, you must determine the real number of unique users, assuming that all email providers have both described features available.

Input

The first line contains an integer $N$ ($1 \leq N \leq 1000$) representing the number of email addresses in the database. Each of the next $N$ lines contains a string of at most $100$ characters representing an email address in the database. Each email address has the form $\textit{<localpart>}\texttt{@}\textit{<provider>}$ where $\textit{<localpart>}$ is a non-empty list of labels with a $\texttt{.}$ (dot) or a $\texttt{+}$ (plus sign) between each pair of consecutive labels, and $\textit{<provider>}$ is a non-empty list of labels always with a $\texttt{.}$ (dot) between each pair of consecutive labels. A label is a non-empty sequence of lowercase letters and/or digits. The character $\texttt{+}$ (plus sign) appears at most once in each email address.

Output

Output a single line with an integer indicating the number of unique users in the database.

Sample test(s)

Input
2 two.different.providers@now.here two.different.providers@nowhere
Output
2
Input
2 1.2.3@testing testing@1.2.3
Output
2
Input
7 alice@e.mail eve@another.mail bob@e.mail joe90@e.mail b.o.b@e.mail bob+new@e.mail bob@another.provider
Output
5