#include <bits/stdc++.h>
using namespace std;
char dc[1005];
int n, cd, ans, cg[1005];
bool visit[26];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    int zj = 0, hh = 1;
    scanf("%s", dc);
    sort(dc, dc + strlen(dc));
    cd = unique(dc, dc + strlen(dc)) - dc;
    for (int j = 0; j < cd; j++) {
      visit[dc[j] - 'a'] = true;
    }
    for (int j = 0; j < 26; j++) {
      hh *= 2;
      if (visit[j]) zj += hh;
    }
    cg[i - 1] = zj;
    memset(dc, '\0', sizeof(dc));
    memset(visit, false, sizeof(visit));
  }
  sort(cg, cg + n);
  ans = unique(cg, cg + n) - cg;
  printf("%d", ans);
  return 0;
}
