#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  set<set<char> > count;
  for (int i = 0; i < n; i++) {
    cin >> s;
    set<char> c(s.begin(), s.end());
    count.insert(c);
  }
  cout << count.size();
  return 0;
}
