#include <bits/stdc++.h>
using namespace std;
vector<string> word;
long long p = 1000000007;
long long p1 = 999969;
long long p2 = 998827;
int main() {
  int n;
  cin >> n;
  word.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> word[i];
  }
  vector<set<int> > root;
  root.resize(n);
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < word[i].size(); j++) {
      root[i].insert(word[i][j]);
    }
  }
  set<set<int> > Set_of_set;
  for (int i = 0; i < n; i++) {
    Set_of_set.insert(root[i]);
  }
  cout << Set_of_set.size() << endl;
}
