#include <stdio.h>
#include <string.h>
#define DIM 36008
char w[DIM][20];
long int n,i,ii,jj,j;
char s[20];
int x,y;
int viz[DIM];
void creHeap(char v[DIM][20], long int n){
long int i,c,p;
char aux[20];
for (i=2;i<=n;i++){
c=i;
p=i/2;
while ((p) && (strcmp(v[c],v[p])>0)) {
/* aux = v[p];
v[p] = v[c];
v[c] = aux;*/
strcpy(aux,v[p]);
strcpy(v[p],v[c]);
strcpy(v[c],aux);
c = p;
p = p/2;
}
}
}
void heapSort(char v[DIM][20], long int n){
long int i,p,c;
char aux[20];
creHeap(v,n);
for (i=n;i>1;i--) {
strcpy(aux,v[1]);
strcpy(v[1],v[i]);
strcpy(v[i],aux);
/* aux = v[i];
v[i]=v[1];
v[1]=aux;*/
p=1;
c=p<<1;
while ((c<=i-1) && (strcmp(v[c],v[p])>=0)) {
if ((c+1<=i-1) && (strcmp(v[c+1],v[c])>0))
c++;
/* aux=v[p];
v[p]=v[c];
v[c]=aux;*/
strcpy(aux,v[p]);
strcpy(v[p],v[c]);
strcpy(v[c],aux);
p=c;
c=p*2;
}
}
}
int main(){
FILE *f = fopen("restante.in","r");
fscanf(f,"%ld",&n);
for (i=1;i<=n;i++){
fscanf(f,"%s",s);
x = strlen(s);
for (ii=0;ii<x-1;ii++)
for (jj=ii+1;jj<=x-1;jj++)
if (s[ii]>s[jj]) {
y = s[ii];
s[ii] = s[jj];
s[jj] = y;
}
// w[i]=new char[20];
strcpy(w[i],s);
int t=strlen(w[i]);
while ((w[i][t]>'z')||(w[i][t]<'a')) {
w[i][t]='\0';
t--;
}
}
fclose(f);
heapSort(w,n);
/* char aux[20];
for (i=1;i<n;i++)
for (j=i+1;j<=n;j++)
if (strcmp(w[i],w[j])>0){
strcpy(aux,w[i]);
strcpy(w[i],w[j]);
strcpy(w[j],aux);
}*/
long int nr=0;
for (i=2;i<n;i++)
if ((strcmp(w[i],w[i-1])!=0)&&(strcmp(w[i],w[i+1])!=0)) {
nr++;
}
if (strcmp(w[2],w[1])!=0)
nr++;
if (strcmp(w[n],w[n-1])!=0)
nr++;
/* j=1;
for (i=2;i<=n;i++)
if ((w[i]!=NULL) && (strcmp(w[i],w[j])!=0)) {
j++;
strcpy(w[j],w[i]);
} else if (w[i]!=NULL) viz[j]=1;
*/
/* for (i=1;i<=j;i++) {
if (viz[i]==0)
nr++;
}*/
FILE *g = fopen("restante.out","w");
fprintf(g,"%ld",nr);
fclose(g);
// for (i=1;i<=n;i++)
// printf("%s\n",w[i]);
// for (i=1;i<=n;i++)
// delete w[i];
// printf("\n");
return 0;
}