#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  scanf("%d", &n);
  string s[1000], s1, s2;
  int cnt1[26] =
      {
          0,
      },
      cnt2[26] =
          {
              0,
          },
      objectCnt = 1;
  for (int i = 0; i < n; ++i) {
    cin >> s[i];
  }
  vector<string> obj;
  string object = "";
  for (int j = 0; j < s[0].length(); ++j) {
    cnt1[s[0][j] - 'a'] = 1;
  }
  for (int i = 0; i < 26; ++i) {
    if (cnt1[i]) {
      object += ('a' + i);
    }
  }
  obj.push_back(object);
  for (int i = 1; i < n; ++i) {
    object = "";
    bool flag = false;
    s2 = s[i];
    for (int j = 0; j < s2.length(); ++j) {
      cnt2[s2[j] - 'a'] = 1;
    }
    for (int j = 0; j < 26; ++j) {
      if (cnt2[j]) {
        object += ('a' + j);
      }
      cnt1[j] = cnt2[j];
      cnt2[j] = 0;
    }
    vector<string>::iterator it = find(obj.begin(), obj.end(), object);
    if (it == obj.end()) {
      flag = true;
      obj.push_back(object);
    }
    s1 = s2;
    if (flag) objectCnt++;
  }
  printf("%d\n", objectCnt);
  return 0;
}
