#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s;
  set<string> s0;
  for (int i = 0; i < n; i++) {
    cin >> s;
    unordered_set<char> s1;
    s.erase(remove_if(s.begin(), s.end(),
                      [&](char const c) { return !(s1.insert(c).second); }),
            s.end());
    sort(s.begin(), s.end());
    s0.insert(s);
  }
  cout << s0.size() << endl;
  return 0;
}
