#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000005;
char a[1050];
set<string> mp;
int main() {
  int n;
  scanf("%d", &n);
  bool vis[30];
  char v[30];
  for (int i = 1; i <= n; i++) {
    scanf("%s", a);
    string ss;
    memset(vis, 0, sizeof vis);
    for (int j = 0; j < strlen(a); j++) {
      vis[a[j] - 'a'] = true;
      ;
    }
    int pos = 0;
    for (int j = 0; j < 26; j++) {
      if (vis[j]) {
        ss += (char)('a' + j);
      }
    }
    mp.insert(ss);
  }
  printf("%d\n", mp.size());
  return 0;
}
