#include <bits/stdc++.h>
const int maxn = 1020;
using namespace std;
char s[maxn][maxn];
bool al[30];
int siz[maxn];
int main() {
  int n, num = 0;
  cin >> n;
  for (int i = 0; i < n; i++) {
    memset(al, false, sizeof(al));
    cin >> s[i];
    for (int j = 0; s[i][j]; j++) {
      al[s[i][j] - 'a'] = true;
    }
    int len = 0;
    for (int j = 0; j < 26; j++) {
      if (al[j]) s[i][len++] = j + 'a';
    }
    s[i][len] = '\n';
    siz[i] = len;
    num++;
    if (i == 0) continue;
    for (int j = 0, k; j < i; j++) {
      if (siz[i] == siz[j]) {
        for (k = 0; k < siz[i]; k++) {
          if (s[i][k] != s[j][k]) break;
        }
        if (k == siz[i]) {
          num--;
          break;
        }
      }
    }
  }
  cout << num << endl;
  return 0;
}
