#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long n;
  cin >> n;
  set<string> S;
  for (long long i = 1; i <= n; i++) {
    string s;
    cin >> s;
    string t;
    set<long long> f;
    for (auto c : s) {
      if (!f.count(c)) {
        t += c;
        f.insert(c);
      }
    }
    sort(t.begin(), t.end());
    S.insert(t);
  }
  cout << S.size();
  return 0;
}
