#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  int co = 0;
  cin >> n;
  int arr[n][26];
  int status[n];
  for (int i = 0; i < n; i++) {
    status[i] = -1;
    for (int j = 0; j < 26; j++) {
      arr[i][j] = 0;
    }
    char s[1001];
    cin >> s;
    for (int j = 0; s[j] != '\0'; j++) {
      arr[i][s[j] - 'a'] = 1;
    }
  }
  for (int i = 0; i < n; i++) {
    if (status[i] == -1) {
      co++;
      for (int j = i + 1; j < n; j++) {
        int k = 0;
        for (k = 0; k < 26; k++) {
          if (arr[i][k] != arr[j][k]) {
            break;
          }
        }
        if (k == 26) {
          status[j] = 0;
        }
      }
    }
  }
  cout << co << endl;
  return 0;
}
