#K94727. Count Unique Problem Statements

    ID: 38706 Type: Default 1000ms 256MiB

Count Unique Problem Statements

Count Unique Problem Statements

Given a list of problem statements, count the number of unique statements by considering anagrams as identical. Two statements are considered the same if, after removing all spaces and sorting their characters, they are equal. For example, "anagram" and "nagaram" are considered identical.

The input begins with an integer n (the number of statements), followed by n lines each containing a statement. Your task is to output the number of unique problem statements.

Note: All statements consist of alphabets and spaces only.

inputFormat

The first line contains an integer n (1 ≤ n ≤ 105), the number of problem statements. Each of the next n lines contains a problem statement made up of lowercase letters and spaces.

outputFormat

Output a single integer representing the number of unique problem statements. Two statements are considered the same if, after removing spaces and sorting the characters, they are identical.

## sample
3
anagram
nagaram
manga ra
1

</p>