#include <bits/stdc++.h>
using namespace std;
const long long mod = 1000000007;
void solve() {
  int n, i, j;
  cin >> n;
  map<string, int> m;
  string s[n];
  for (i = 0; i < n; i++) cin >> s[i];
  for (i = 0; i < n; i++) {
    int a[26] = {0};
    string ch = "";
    char d;
    for (j = 0; j < s[i].length(); j++) {
      if (a[s[i][j] - 97] == 0) {
        a[s[i][j] - 97]++;
        d = s[i][j];
        ch = ch + d;
      }
      sort(ch.begin(), ch.end());
    }
    if (m.find(ch) == m.end()) m[ch]++;
  }
  cout << m.size();
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
