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

public class language_petr implements Runnable {
    final String TASK_ID = "language";
    final String IN_FILE = TASK_ID + ".in";
    final String OUT_FILE = TASK_ID + ".out";

    public static void main(String[] args) {
        Locale.setDefault(Locale.US);
        new Thread(new language_petr()).start();
    }

    public void run() {
        try {
            readInput();
            solve();
            writeOutput();
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(57);
        }
    }

    private void solve() {
        Set<List<String>> all = new HashSet<List<String>>();
        Map<String, Set<String>> prefixes = new HashMap<String, Set<String>>();
        for (String word : w) {
            for (int i = 0; i <= word.length(); ++i) {
                String prefix = word.substring(0, i);
                String suffix = word.substring(i);
                if (!prefixes.containsKey(prefix)) {
                    prefixes.put(prefix, new TreeSet<String>());
                }
                prefixes.get(prefix).add(suffix);
            }
        }
        for (Set<String> cur : prefixes.values()) {
            List<String> l = new ArrayList<String>(cur);
            all.add(l);
        }
        res = all.size();
    }

    int res;

    private void writeOutput() throws FileNotFoundException {
        PrintWriter writer = new PrintWriter(OUT_FILE);

        writer.println(res);

        writer.close();
    }

    String[] w;

    private void readInput() throws IOException {
        reader = new BufferedReader(new FileReader(IN_FILE));
        tokenizer = null;

        int n = nextInt();
        w = new String[n];
        for (int i = 0; i < n; ++i) {
            w[i] = nextToken();
        }
    }

    StringTokenizer tokenizer;
    BufferedReader reader;

    String nextToken() throws IOException {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(reader.readLine());
        }
        return tokenizer.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

}
