#include <bits/stdc++.h>
using namespace std;
char a[1010][1010];
int b[1010][30], c[1010][30];
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < strlen(a[i]); j++) {
      int d = a[i][j] - 'a';
      b[i][d]++;
    }
    int cnt = 0;
    for (int j = 0; j < 30; j++) {
      if (b[i][j] != 0) c[i][cnt++] = j + 1;
    }
    sort(c[i], c[i] + cnt);
  }
  int ans = 0;
  for (int i = 0; i < n - 1; i++) {
    for (int j = i + 1; j < n; j++) {
      int flag = 1;
      for (int k = 0; k < 30; k++) {
        if (c[i][k] != c[j][k]) {
          flag = 0;
          break;
        }
      }
      if (flag == 1) c[j][0] = 0;
    }
  }
  for (int i = 0; i < n; i++) {
    if (c[i][0] != 0) ans++;
  }
  cout << ans << endl;
  return 0;
}
