#include <bits/stdc++.h>
using namespace std;
string rem(string str, int n) {
  char ss[1000];
  ss[0] = str[0];
  int q = 1;
  for (int i = 1; str[i]; i++) {
    if (str[i] != str[i - 1]) {
      ss[q] = str[i];
      q++;
    }
  }
  ss[q] = '\0';
  string x = ss;
  return x;
}
int main() {
  int n, c = 0, ans = 0, i;
  cin >> n;
  map<string, int> mp;
  mp.clear();
  string s;
  char* ss;
  for (i = 0; i < n; i++) {
    cin >> s;
    sort(s.begin(), s.end());
    s = rem(s, s.length());
    if (mp[s] == 0) {
      ans++;
      mp[s]++;
    }
  }
  cout << ans;
  return 0;
}
