#include <bits/stdc++.h>
#ifdef ONLINE_JUDGE
	#define out(x)
#else
	#define out(x) cerr<<#x"="<<(x)<<endl
#endif
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> vi;
typedef pair<ULL, ULL> pii;
typedef vector<pii> vpii;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define pb push_back
#define mp make_pair
#define X first
#define Y second
const int P0=1e9+7, P1=9875321;
struct Node{
	int cnt, ch[26];
	Node(bool f):cnt(0){
		memset(ch, -1, sizeof ch);
	}
	Node(){}
} v[5123*30];
int tot;
void init(){
	tot=1;
	v[0]=Node(1);
}
void insert(const char *s){
	int now=0;
	for(; *s; ++s){
		int &ch=v[now].ch[*s-'a'];
		if(~ch)now=ch;
		else {
			now=ch=tot;
			v[tot++]=Node(1);
		}
	}
	v[now].cnt++;
}
vector<ULL> ans;
pii dfs(int x){
	ULL a=123, b=3;
	int (&e)[26]=v[x].ch;
	REP(i,26){
		if(~e[i]){
			pii t=dfs(e[i]);
			a=a*P0+t.X;
			b=b*P1+t.Y;
		} else a*=P0, b*=P1;
	}
	a=a*P0+v[x].cnt;
	b=b*P1+v[x].cnt;
	ans.pb(a);
	return mp(a,b);
}
char buf[113];
int main(){
	freopen("language.in", "r", stdin);
	freopen("language.out", "w", stdout);
	int n;
	scanf("%d",&n);
	init();
	REP(tt,n){
		scanf("%s",buf);
		insert(buf);
	}
	dfs(0);
	sort(ans.begin(), ans.end());
	int res=unique(ans.begin(), ans.end())-ans.begin();
	printf("%d\n", res);
}
