A spice workshop labels each blend with a short code made of lowercase English letters. Two codes belong to the same anagram family if one can be rearranged into the other (they use exactly the same letters with the same multiplicities). Count how many distinct anagram families appear among the given codes.
Input format
Line 1: an integer n, the number of blend codes.
Line 2: n space-separated codes, each 1 to 20 lowercase English letters.
Output format
A single integer: the number of distinct anagram families.
Constraints
- 1 <= n <= 40
- Each code is 1 to 20 lowercase English letters.