public static void main(String args[]) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt(); in.nextLine();

        int numbersOfNodes = 0;
        Map<Character, Node> rootNodes = new HashMap<Character, Node>();

        for (int i = 0; i < n; i++) {
            String numero = in.nextLine();

            Map<Character, Node> currentRoots = rootNodes;

            for (char digit : numero.toCharArray()) {
                if (!currentRoots.containsKey(digit)) {
                    currentRoots.put(digit, new Node());
                    numbersOfNodes++;
                }
                currentRoots = currentRoots.get(digit).childs;

            }
        }
        System.out.println(numbersOfNodes);
    }