#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  long long r;
  while (b) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
long long power(long long x, long long y) {
  if (y == 0)
    return 1;
  else if (y % 2 == 0)
    return power(x, y / 2) * power(x, y / 2);
  else
    return x * power(x, y / 2) * power(x, y / 2);
}
long long fpow(long long n, long long k, long long p = 1000000007) {
  long long r = 1;
  for (; k; k >>= 1) {
    if (k & 1) r = r * n % p;
    n = n * n % p;
  }
  return r;
}
long long inv(long long a, long long p = 1000000007) {
  return fpow(a, p - 2, p);
}
bool pr[1000007];
void sieve() {
  pr[0] = 1;
  pr[1] = 1;
  for (int i = 2; i < sqrt(1000007); i++) {
    for (int j = 2 * i; j <= 1000007; j += i) {
      pr[j] = 1;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  int cnt = 0;
  map<string, int> mymap;
  while (n--) {
    bool a[26];
    memset(a, false, sizeof(a));
    string root = "";
    string temp;
    cin >> temp;
    for (int i = 0; i < temp.length(); i++) {
      a[temp[i] - 97] = true;
    }
    for (int i = 0; i < 26; i++) {
      if (a[i] == true) {
        root = root + (char)(i + 97);
      }
    }
    mymap.insert(pair<string, int>(root, 1));
  }
  cout << mymap.size() << endl;
  return 0;
}
