#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  map<string, int> m;
  cin >> n;
  string s;
  for (int i = 1; i <= n; i++) {
    cin >> s;
    string k = "";
    sort(s.begin(), s.end());
    k += s[0];
    for (int j = 1; j < s.length(); j++) {
      if (s[j] != s[j - 1]) k += s[j];
    }
    m[k] = 1;
  }
  cout << m.size();
}
