#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  vector<int> V;
  for (int i = 0; i < n; i++) {
    char S[1005];
    scanf(" %s", S);
    int len = strlen(S);
    int a = 0;
    for (int j = 0; j < len; j++) {
      a |= (1 << (S[j] - 'a' + 1));
    }
    bool found = true;
    for (int j = 0; j < V.size(); j++) {
      if (a == V[j]) {
        found = false;
        break;
      }
    }
    if (found) V.push_back(a);
  }
  printf("%d", V.size());
}
