/*--------------------------------------------------------------*/
/* ACM ICPC 2007-2008                                           */
/* Northeastern European Regional Contest                       */
/* St Petersburg - Barnaul - Tashkent - Batumi, November 28, 200*/
/*--------------------------------------------------------------*/
/* Problem L. Language Recognition                              */
/*--------------------------------------------------------------*/
/* Solution                                                     */
/*                                                              */
/* Author                Georgiy Korneev                        */
/*--------------------------------------------------------------*/
 
import java.io.*;
import java.util.*;

public class language_gk {
    static Scanner in;
    static PrintWriter out;

    Map<Node, Integer> nodeCodes = new HashMap<Node, Integer>();
    int lastCode = 1;

    class Node {
        Node[] nodes = new Node[26];
        int[] codes = new int[26];
        boolean finish;

        void add(char[] chars, int i) {
            if (i == chars.length) {
                finish = true;
            } else {
                int index = chars[i] - 'a';
                if (nodes[index] == null) {
                    nodes[index] = new Node();
                }
                nodes[index].add(chars, i + 1);
            }
        }

        int compress() {
            for (int i = 0; i < 26; i++) {
                Node node = nodes[i];
                if (node != null) {
                    codes[i] = node.compress();
                }
            }
            if (!nodeCodes.containsKey(this)) {
                nodeCodes.put(this, lastCode++);
            }
            return nodeCodes.get(this);
        }

        @Override
        public boolean equals(Object o) {
            Node that = (Node) o;
            return this.finish == that.finish && Arrays.equals(this.codes, that.codes);
        }

        @Override
        public int hashCode() {
            return Arrays.hashCode(codes) + (finish ? 17 : 0);
        }
    }

    void run() {
        Node root = new Node();

        int n = in.nextInt();
        for (int i = 0; i < n; i++) {
            String word = in.next();
            root.add(word.toCharArray(), 0);
        }

        out.println(root.compress());
    }

    public static void main(String[] args) throws IOException {
        in = new Scanner(System.in);
        out = new PrintWriter(System.out);

        while (in.hasNext()) {
            new language_gk().run();
        }

        out.close();
        in.close();
    }
}
