import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Balloon
{
	public static void main(String[] args)
	{
		Scanner in = new Scanner(System.in);

		Set<Integer> categories;

		int samples;
		String line;

		boolean hasPrevious = false;
		while ((line = in.nextLine()).length() > 0)
		{
			samples = Integer.parseInt(line);
			categories = new HashSet<>();

			for (int n = 0; n < samples; n++)
			{
				char[] chars = in.nextLine().toCharArray();

				Category cat = new Category();
				for (int m = 0; m < chars.length; m++)
				{
					cat.putNumber(chToInt(chars[m]));
				}

				categories.add(cat.mask);
			}

			if (hasPrevious)
				System.out.println();

			System.out.print(categories.size());
			hasPrevious = true;
		}

		// in.close();

		// System.exit(0);
	}

	public static int chToInt(char c)
	{
		return ((int) c) - 48;
	}

	static class Category
	{
		public int mask;

		public Category()
		{
			mask = 0;
		}

		public void putNumber(int number)
		{
			mask = mask | (int) Math.pow(2, number - 1);
		}

		public boolean areSame(short another)
		{
			return mask == another;
		}
	}
}
