#include <bits/stdc++.h>
using namespace std;
long long i, j, n, t;
int main() {
  cin >> n;
  set<string> s;
  for (long long(i) = (0); (i) < (n); ++(i)) {
    string b;
    cin >> b;
    set<char> c;
    sort(b.begin(), b.end());
    for (long long(j) = (0); (j) < (b.size()); ++(j)) {
      c.insert(b[j]);
    }
    b = "";
    set<char>::iterator it = c.begin();
    while (it != c.end()) {
      b += *it;
      it++;
    }
    s.insert(b);
    c.clear();
  }
  cout << s.size();
  return 0;
}
