#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  string s;
  vector<string> v;
  cin >> n;
  while (n--) {
    cin >> s;
    sort(s.begin(), s.end());
    s.erase(unique(s.begin(), s.end()), s.end());
    v.push_back(s);
  }
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  cout << v.size();
  return 0;
}
