#include <bits/stdc++.h>
using namespace std;
set<string> st;
int main() {
  int n;
  while (cin >> n) {
    string s;
    for (int i = 0; i < n; i++) {
      cin >> s;
      int vis[30] = {0};
      string ss;
      for (int j = 0; j < s.size(); j++) {
        if (vis[s[j] - 'a']) continue;
        ss += s[j];
        vis[s[j] - 'a'] = 1;
      }
      sort(ss.begin(), ss.end());
      st.insert(ss);
    }
    cout << st.size() << endl;
  }
  return 0;
}
