#include <bits/stdc++.h>
using namespace std;
bool a[1010][30];
char c[1010];
bool temp[30];
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  int num = 0;
  while (n--) {
    cin >> c;
    memset(temp, 0, sizeof(temp));
    int len = strlen(c);
    for (int i = 0; i < len; i++) temp[c[i] - 'a'] = 1;
    bool flag2 = 1;
    for (int i = 0; i < num; i++) {
      bool flag = 1;
      for (int j = 0; j < 26; j++) {
        if (a[i][j] != temp[j]) {
          flag = 0;
          break;
        }
      }
      if (flag) flag2 = 0;
    }
    if (flag2) {
      for (int i = 0; i < 26; i++) a[num][i] = temp[i];
      num++;
    }
  }
  cout << num << endl;
  return 0;
}
