#include <bits/stdc++.h>
using namespace std;
long long check(int n, string s);
int ans = 1;
int main() {
  int n;
  cin >> n;
  string s[n];
  long long x[n];
  for (int i = 0; i < n; i++) {
    cin >> s[i];
  }
  long long curr;
  for (int i = 0; i < n; i++) {
    long long curr = check(i, s[i]);
    x[i] = curr;
  }
  bool lmao = true;
  for (int i = 1; i < n; i++) {
    for (int j = 0; j < i; j++) {
      if (x[j] == x[i]) {
        lmao = false;
      }
    }
    if (lmao == true) {
      ans++;
    }
    lmao = true;
  }
  cout << ans << endl;
  return 0;
}
long long check(int n, string s) {
  bool chars[26];
  int temp = 0;
  for (int i = 0; i < 26; i++) {
    chars[i] = false;
  }
  int l = s.length();
  for (int i = 0; i < l; i++) {
    if (chars[int(s[i]) - 97] == false) {
      chars[int(s[i]) - 97] = true;
    }
  }
  int counter = 1;
  for (int i = 0; i < 26; i++) {
    if (chars[i] == true) {
      temp = temp + pow(2, counter);
    }
    counter++;
  }
  return temp;
}
