#include<bits/stdc++.h>
using namespace std;
char a[114514];
bool mp[7145140];
int mp2[7145140];
int n;
int mp3[7145140];
int mp4[7145140];
int hah(int x)
{
int tmp=0;
while(x!=0)
{
tmp=tmp*97+x%10;
x/=10;
tmp%=7142887;
}
return tmp;
}
int main()
{
cin>>n;
int k=n;
for(int i=1;i<=n;i++)
{
cin>>a;
int len=strlen(a);
int tmp=len*len;
for(int j=0;j<=(len/2);j++)
swap(a[j],a[len-j-1]);
for(int j=0;j<len;j++)
{
tmp=tmp*131+a[j];
tmp%=7142887;
}
tmp=hah(tmp);
if(mp[tmp]==true&&mp2[tmp]==len&&mp3[tmp]==a[0])
{
k--;
}
int l=0;
while(mp[tmp]==true&&mp2[tmp]!=len)
{
tmp=hah(tmp);
l++;
}
while(mp[tmp]==true&&mp2[tmp]==len&&mp3[tmp]!=a[0])
{
tmp=hah(tmp);
l++;
}
while(mp[tmp]==true&&mp2[tmp]==len&&mp3[tmp]==a[0]&&l!=mp4[tmp])
{
tmp=hah(tmp);
l++;
}
mp[tmp]=true;
mp2[tmp]=len;
mp3[tmp]=a[0];
mp4[tmp]=l;
}
cout<<k;
return 0;
}