#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  int i = 0, j = 0;
  char s[1003][1003] = {0};
  char a[1003][30] = {0};
  for (i = 0; i < n; i++) {
    for (j = 0; j < 26; j++) a[i][j] = '0';
  }
  int c = 0;
  for (i = 0; i < n; i++) {
    cin >> s[i];
    for (j = 0; j < strlen(s[i]); j++) {
      a[i][s[i][j] - 'a'] = '1';
    }
    int flag = 0;
    for (j = i - 1; j >= 0; j--) {
      if (strcmp(a[i], a[j]) == 0) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) c++;
  }
  cout << c << endl;
  return 0;
}
