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