#include <iostream>
#include <fstream>
#include <cstring>
#include <algorithm>
using namespace std;
ifstream f("restante.in");
ofstream g("restante.out");
int nr;
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);
sort(s[i],s[i]+strlen(s[i]));
}
for(int i=0; i<=35999; i++)V[i]=1;
for(int i=0; i<n-1; i++)
{
if(V[i])
{
for(int j=i+1; j<n; j++)
{
if(strcmp(s[i],s[j])==0)
{
V[i]=0;
V[j]=0;
}
}
if(V[i])nr++;
}
}
if(V[n-1])nr++;
g<<nr;
return 0;
}