#include <bits/stdc++.h>
using namespace std;
long long int k, n;
string s, x;
queue<string> q;
vector<string> v;
set<string> h;
int main(int argc, char** argv) {
  cin >> n;
  for (int i = 0; i < n; i += 1) {
    cin >> x;
    int r = x.length();
    sort(x.begin(), x.end());
    s = x[0];
    k = 0;
    for (int j = 1; j < r; j++) {
      if (s[k] != x[j]) {
        s += x[j];
        k++;
      }
    }
    if (h.count(s) == 0) h.insert(s);
  }
  cout << h.size();
  return 0;
}
