#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, count = 0;
  string s;
  map<string, int> mp;
  cin >> a;
  for (int j = 1; j <= a; j++) {
    cin >> s;
    set<char> se;
    int ss = s.size();
    string kk;
    map<char, int> mm;
    for (int i = 0; i < ss; i++) {
      if (mm[s[i]] == 0) {
        kk += s[i];
        mm[s[i]]++;
      }
    }
    sort(kk.begin(), kk.end());
    if (mp[kk] == 0) {
      mp[kk]++;
      count++;
    }
  }
  cout << count << endl;
  return 0;
}
