#include <bits/stdc++.h>
#include <fstream>
#include <string>
using namespace std;
ifstream f("restante.in");
ofstream g("restante.out");
int main()
{
int n, i, j, nr = 0;
char s[36005][20], c[20];
f >> n;
for (i = 0; i < n; i++)
{
f >> s[i];
sort(s[i], s[i] + strlen(s[i]));
}
for (i = 0; i < n - 1; i++)
{
for (j = i + 1; j < n; j++)
{
if (strcmp(s[i], s[j]) > 0)
{
strcpy(c, s[i]);
strcpy(s[i], s[j]);
strcpy(s[j], c);
}
}
}
for (i = 0; i < n; i++)
{
bool unic = true;
if (i > 0 && strcmp(s[i], s[i - 1]) == 0)
{
unic = false;
}
if (i < n - 1 && strcmp(s[i], s[i + 1]) == 0)
{
unic = false;
}
if (unic)
{
nr++;
}
}
g << nr;
return 0;
}