#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d\n", &n);
  vector<string> v;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    v.push_back(s);
  }
  set<string> mp;
  int cs[26];
  for (int i = 0; i < n; i++) {
    for (int i = 0; i < 26; i++) {
      cs[i] = 0;
    }
    for (int j = 0; j < v[i].length(); j++) {
      cs[v[i][j] - 'a'] = 1;
    }
    string s;
    for (int i = 0; i < 26; i++) {
      if (cs[i]) {
        s += (char)('a' + i);
      }
    }
    mp.insert(s);
  }
  cout << mp.size() << endl;
  return 0;
}
