#include <bits/stdc++.h>
using namespace std;
set<string> dict;
int main() {
  int n, a[1005], vis[30];
  cin >> n;
  string ss;
  for (int i = 0; i < n; i++) {
    cin >> ss;
    memset(vis, 0, sizeof(vis));
    string s;
    for (int j = 0; j < ss.length(); j++) {
      vis[ss[j] - 'a'] = 1;
    }
    for (int j = 0; j <= 26; j++) {
      if (vis[j] == 1) {
        s += 'a' + j;
      }
    }
    dict.insert(s);
  }
  cout << dict.size() << endl;
  return 0;
}
