#include <bits/stdc++.h>
using namespace std;
template <class T>
inline bool fs(T &x) {
  int c = getchar();
  int sgn = 1;
  while (~c && c < '0' || c > '9') {
    if (c == '-') sgn = -1;
    c = getchar();
  }
  for (x = 0; ~c && '0' <= c && c <= '9'; c = getchar()) x = x * 10 + c - '0';
  x *= sgn;
  return ~c;
}
int main() {
  set<string> st;
  int a, n;
  string s;
  cin >> n;
  for (int i = 0; i < n; i++) {
    bool mark[1000] = {0};
    int d = 0;
    string s1;
    cin >> s;
    for (int j = 0; s[j]; j++) {
      a = s[j];
      if (!mark[a]) {
        mark[a] = true;
        d++;
      }
    }
    for (int i = 'a'; i <= 'z'; i++) {
      if (mark[i]) s1.push_back(i);
    }
    st.insert(s1);
  }
  cout << st.size() << endl;
  return 0;
}
