#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
using namespace std;
ifstream f("restante.in");
ofstream g("restante.out");
int nr,fv[26];
bool V[36000];
int main()
{
int n;
char s[36000][17];
f>>n;
f.get();
for(int i=0; i<n; i++)
{
f.getline(s[i],17);
for(int j=0;j<26;j++)fv[j]=0;
for(int j=0;s[i][j]!='\0';j++)fv[int(s[i][j]-97)]++;
int k=0;
for(int j=0;j<26;j++)
{
while(fv[j]!=0)
{
s[i][k++]=char(j+97);
fv[j]--;
}
}
//sort(s[i],s[i]+strlen(s[i]));
}
for(int i=0; i<n-1; i++)
{
if(!V[i])
{
for(int j=i+1; j<n; j++)
{
if(!V[j])
{
if(strcmp(s[i],s[j])==0)
{
V[i]=1;
V[j]=1;
}
}
}
if(!V[i])nr++;
}
}
if(!V[n-1])nr++;
g<<nr;
return 0;
}