#include <bits/stdc++.h>
using namespace std;
char s[1002][1002];
bool v[28];
long long b[1002];
bool cmp(long long aa, long long bb) { return aa > bb; }
int main() {
  int n, i, j, len, ans = 0;
  long long l;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    b[i] = 0;
    scanf("%s", s[i]);
    len = strlen(s[i]);
    for (j = 0; j < 26; j++) v[j] = false;
    for (j = 0; j < len; j++) v[s[i][j] - 'a'] = true;
    for (j = 0; j < 26; j++) {
      if (v[j]) b[i]++;
      b[i] <<= 1;
    }
  }
  sort(b + 1, b + 1 + n, cmp);
  l = b[1];
  ans++;
  for (i = 2; i <= n; i++) {
    if (b[i] != l) {
      l = b[i];
      ans++;
    }
  }
  printf("%d", ans);
  return 0;
}
