#include <bits/stdc++.h>
using namespace std;
set<string> table;
int main() {
  long long n, sz;
  char s[1001];
  char s1[1001];
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    bool letter[26] = {0};
    sz = strlen(s);
    sort(s, s + sz);
    for (int j = 0, k = 0; j < sz; ++j) {
      if (letter[s[j] - 'a'] == 0) {
        letter[s[j] - 'a'] = 1;
        s1[k++] = s[j];
        s1[k] = '\0';
      }
    }
    table.insert(s1);
  }
  cout << table.size() << endl;
  return 0;
}
