#include <bits/stdc++.h>
using namespace std;
int main() {
  set<string> s;
  int n;
  cin >> n;
  while (n--) {
    string a;
    cin >> a;
    sort(a.begin(), a.end());
    a.erase(unique(a.begin(), a.end()), a.end());
    s.insert(a);
  }
  printf("%d\n", s.size());
  return 0;
}
