#include <bits/stdc++.h>
int main() {
  int n;
  scanf("%d", &n);
  char s[n][1002];
  int i, j, arm_cnt = n;
  for (i = 0; i < n; i++) {
    scanf("%s", &s[i]);
  }
  int arm[n][26];
  int arm_temp[26];
  for (i = 0; i < n; i++)
    for (j = 0; j < 26; j++) arm[i][j] = 0;
  for (i = 0; i < n; i++) {
    for (j = 0; j < strlen(s[i]); j++) {
      arm[i][(int)s[i][j] - 97] = (arm[i][(int)s[i][j] - 97] == 0) ? 1 : 1;
    }
  }
  int k;
  int check, count = 0;
  for (i = 0; i < n; i++) {
    count = 0;
    for (j = i + 1; j < n; j++) {
      for (k = 0; k < 26; k++) {
        if (arm[i][k] == arm[j][k])
          check = 0;
        else {
          check = 1;
          break;
        }
      }
      if (check == 0) {
        count = 1;
        break;
      }
    }
    arm_cnt -= count;
  }
  printf("%d", arm_cnt);
}
