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