#include <fstream>
#include <cstring>
#include <algorithm>
using namespace std;
ifstream fin("restante.in");
ofstream fout("restante.out");
int main()
{
int n, nr = 0;
fin >> n;
char s[36001][17];
for(int i = 0; i < n; i++){
fin >> s[i];
sort(s[i], s[i] + strlen(s[i]));
}
for(int i = 0; i < n - 1; i++)
for(int j = i + 1; j < n; j++)
if(strcmp(s[i], s[j]) > 0)
swap(s[i], s[j]);
for(int i = 0; i < n; i++)
if((i == 0 || strcmp(s[i], s[i - 1]) != 0) &&
(i == n - 1 || strcmp(s[i], s[i + 1]) != 0))
nr++;
fout << nr;
return 0;
}