import java.io.*; import java.util.HashSet; import java.util.Set; /* * To change this license header, choose License Headers in Project Properties. * To change this template file, choose Tools | Templates * and open the template in the editor. */ /** * * @author cteam071 */ public class Balloon {public static BufferedReader in; public static void main(String[] args) throws IOException { in = new BufferedReader(new InputStreamReader(System.in)); String line; int trainees; Set set; while((line = in.readLine()) != null){ set = new HashSet(); trainees = Integer.parseInt(line); for (int i=0; i< trainees; i++){ boolean[] balloons = {false,false,false,false,false,false,false,false,false}; line = in.readLine(); for(int j = 0; j < line.length(); j++){ balloons[Integer.parseInt(String.valueOf(line.charAt(j))) - 1] = true; } String s = ""; for(int j = 0; j < 9; j++){ if (balloons[j]){ s += j+1; } } set.add(s); } System.out.println(set.size()); } } }