#include <bits/stdc++.h>
using namespace std;
int n, m, i, j, k, x, y, z;
int e[26];
long long f[26], g;
char s[1010];
int L, cl, ans;
map<long long, int> mp;
int main() {
  ios ::sync_with_stdio(false);
  cin >> n;
  f[0] = 1;
  for (i = 1; i < 26; i++) f[i] = f[i - 1] * 26;
  while (n--) {
    cin >> s;
    L = strlen(s);
    cl++;
    g = 0;
    for (i = 0; i < L; i++) {
      if (e[s[i] - 'a'] != cl) {
        e[s[i] - 'a'] = cl;
        g += f[s[i] - 'a'];
      }
    }
    if (mp[g] == 0) {
      mp[g] = 1;
      ans++;
    }
  }
  cout << ans;
  return 0;
}
