#include <bits/stdc++.h>
using namespace std;
long long int a[35], b[1005], u[1005], a2[1005];
char a1[1005][1005];
int main() {
  long long int i, j, k, l, t, m, n, p, y, s = 0;
  scanf("%lld", &n);
  for (i = 0; i < n; i++) {
    scanf("%s", a1[i]);
    k = strlen(a1[i]);
    u[i] = 0;
    b[i] = 0;
    for (j = 0; j < 26; j++) a[j] = 0;
    for (j = 0; j < k; j++) {
      y = a1[i][j] - 97;
      a[y]++;
      if (a[y] == 1) a2[u[i]++] = (int)a1[i][j];
    }
    sort(a2, a2 + u[i]);
    for (j = 0; j < u[i]; j++) a1[i][j] = (char)a2[j];
  }
  for (i = 0; i < n; i++) {
    if (b[i] == 1) continue;
    for (j = i + 1; j < n; j++) {
      if (u[i] == u[j] && b[j] == 0) {
        for (k = 0; k < u[i]; k++) {
          if (a1[i][k] != a1[j][k]) break;
        }
        if (k == u[i]) b[j] = 1;
      }
    }
  }
  for (i = 0; i < n; i++) {
    if (b[i] == 0) s++;
  }
  printf("%lld", s);
  return 0;
}
