#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios::sync_with_stdio(NULL);
  cin.tie(NULL);
  cout.tie(NULL);
  long long n;
  cin >> n;
  map<string, long long> m;
  for (long long i = 0; i < n; i++) {
    string str;
    cin >> str;
    sort(str.begin(), str.end());
    vector<long long> v(26, 0);
    string ans = "";
    for (long long i = 0; i < str.length(); i++) {
      if (v[str[i] - 'a'] == 0) ans += str[i];
      v[str[i] - 'a']++;
    }
    m[ans]++;
  }
  cout << m.size();
  return 0;
}
