#include <bits/stdc++.h>
using namespace std;
int main() {
  string str;
  unordered_map<string, char> index;
  int t;
  cin >> t;
  while (t--) {
    cin >> str;
    sort(str.begin(), str.end());
    str = str.substr(0, unique(str.begin(), str.end()) - str.begin());
    if (index.find(str) == index.end()) {
      index.insert(unordered_map<string, char>::value_type(str, 'c'));
    }
  }
  cout << index.size() << endl;
}
