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

public class language_rs implements Runnable {
	private BufferedReader in;
	private PrintWriter out;
	private int[][] go;
	private long[] hash;
	private boolean[] finish;
	private long[] coef;
	private int bsize;
	private Set<Long> hashes;
	
	private void add2bor(char[] word) {
		int curPos = 0;
		for (int i = 0; i < word.length; i++) {
			int curChar = word[i] - 'a';
			if (go[curPos][curChar] == -1) {
				go[curPos][curChar] = bsize;
				Arrays.fill(go[bsize], -1);
				bsize++;
			}
			curPos = go[curPos][curChar];
		}
		finish[curPos] = true;
	}

	private void calcHash(int u) {
		if (u == -1) {
			return;
		}
		for (int i = 0; i < 26; i++) {
			calcHash(go[u][i]);
		}
		hash[u] = (finish[u]) ? 83475835 : 38475835;
		for (int i = 0; i < 26; i++) {
			hash[u] = hash[u] + ((go[u][i] == -1) ? 0 : hash[go[u][i]] * coef[i]);
		}
		hashes.add(hash[u]);
	}

	private void solve() throws IOException {
		int n = Integer.parseInt(in.readLine());
		go = new int[31 * n + 239][26];
		finish = new boolean[31 * n + 239];
		bsize = 1;
		Arrays.fill(go[0], -1);
		for (int i = 0; i < n; i++) {
			add2bor(in.readLine().toCharArray());
		}
		hash = new long[bsize];
		coef = new long[26];
		Random rnd = new Random(432758235);
		for (int i = 0; i < 26; i++) {
			coef[i] = rnd.nextLong();
		}
		hashes = new HashSet<Long>(); 
		calcHash(0);
		out.println(hashes.size());
	}
	
	public static void main(String[] args) {
		new Thread(new language_rs()).start();
	}

	public void run() {
		String problem = getClass().getName().split("_")[0];
		try {
			in = new BufferedReader(new FileReader(new File(problem + ".in")));
			out = new PrintWriter(new File(problem + ".out"));
			solve();
			in.close();
			out.close();
		} catch (IOException e) {
			e.printStackTrace();
			System.exit(1);
		}
	}
}
