#include <bits/stdc++.h>
long long int a[100000];
using namespace std;
int main() {
  long long int i, j, n, t, c = 0;
  map<string, long long int> mp;
  map<string, long long int>::iterator it;
  vector<long long int> v;
  list<long long int> l;
  cin >> n;
  for (i = 0; i < n; i++) {
    string s1;
    cin >> s1;
    sort(s1.begin(), s1.end());
    for (j = 0; j < s1.size() - 1; j) {
      if (s1[j] == s1[j + 1])
        s1.erase(j, 1);
      else
        j++;
    }
    mp[s1]++;
  }
  for (it = mp.begin(); it != mp.end(); it++) {
    if (it->second > 0) c++;
  }
  cout << c << endl;
  return 0;
}
