#include <bits/stdc++.h>
using namespace std;
int main() {
  int t, num[30];
  cin >> t;
  char str[1002][1002], str2[1002][1002];
  for (int i = 0; i < t; i++) {
    cin >> str[i];
  }
  for (int i = 0; i < t; i++) {
    for (int j = 0; j < 26; j++) num[j] = 0;
    for (int j = 0; j < strlen(str[i]); j++) {
      num[str[i][j] - 'a']++;
    }
    int p = 0;
    for (int j = 0; j < 26; j++) {
      if (num[j] != 0) {
        str2[i][p++] = 'a' + j;
      }
    }
  }
  int vis[1002], ans = 0;
  for (int i = 0; i < 1002; i++) vis[i] = 0;
  for (int i = 0; i < t; i++) {
    int brk = 0;
    for (int j = 0; j < t; j++) {
      if (vis[j] == 0 && strcmp(str2[i], str2[j]) == 0) {
        vis[j] = 1;
        if (brk == 0) ans++;
        brk = 1;
      }
    }
  }
  cout << ans << endl;
  return 0;
}
