Description

Not so long ago a group of scientists from the Americas Centre for Messaging (ACM) came up with a new way to encode messages. The algorithm begins by generating a list of keys L which are later on used to encode different messages. Like many other algorithms out there, this one worked perfectly until a vulnerability was detected immediately exploited. The first investigation report indicates that the algorithm fails whenever two or more keys are similar, that is, when they are composed of exactly the same digits. A quick-fix to this problem is quite simple: for each group of K similar keys, the algorithm must take K - 1 off L.

Your task is very simple. Write a program that calculates the final size of L.

Not so long ago a group of scientists from the Americas Centre for Messaging (ACM) came up with a new way to encode messages. The algorithm begins by generating a list of keys L which are later on used to encode different messages. Like many other algorithms out there, this one worked perfectly until a vulnerability was detected immediately exploited. The first investigation report indicates that the algorithm fails whenever two or more keys are similar, that is, when they are composed of exactly the same digits. A quick-fix to this problem is quite simple: for each group of K similar keys, the algorithm must take K - 1 off L.

Your task is very simple. Write a program that calculates the final size of L.

Not so long ago a group of scientists from the Americas Centre for Messaging (ACM) came up with a new way to encode messages. The algorithm begins by generating a list of keys L which are later on used to encode different messages. Like many other algorithms out there, this one worked perfectly until a vulnerability was detected immediately exploited. The first investigation report indicates that the algorithm fails whenever two or more keys are similar, that is, when they are composed of exactly the same digits. A quick-fix to this problem is quite simple: for each group of K similar keys, the algorithm must take K - 1 off L.

Your task is very simple. Write a program that calculates the final size of L.

Input specification

Line 1: the number N (1 <= N <= 10^5) of keys in L.Lines 2 … N + 1: a key in L. It is guaranteed that all keys will contain no more than 31 digits and no key starts with a digit zero.

Line 1: the number N (1 <= N <= 10^5) of keys in L.Lines 2 … N + 1: a key in L. It is guaranteed that all keys will contain no more than 31 digits and no key starts with a digit zero.

Line 1: the number N (1 <= N <= 10^5) of keys in L.Lines 2 … N + 1: a key in L. It is guaranteed that all keys will contain no more than 31 digits and no key starts with a digit zero.

Output specification

A single line with the answer to the problem.

A single line with the answer to the problem.

Line 1: the number N (1 <= N <= 10^5) of keys in L.Lines 2 … N + 1: a key in L. It is guaranteed that all keys will contain no more than 31 digits and no key starts with a digit zero.