#include <bits/stdc++.h>
using namespace std;
const long long INF = 1e18;
const long long MAXN = 1e8;
const long long MOD = 1e9 + 7;
const double EPS = 1e-12;
const vector<long long> dx = {1, 0, -1, 0, 0, 1, 0, -1};
long long power(long long x, long long n, long long mod = 1e9 + 7) {
  if (n == 0) return 1ll;
  if (n & 1ll) return power(x, n - 1ll, mod) * x % mod;
  long long tmp = power(x, n >> 1ll, mod);
  return (tmp * tmp) % mod;
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long a, long long b) { return a / gcd(a, b) * b; }
signed main() {
  iostream::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  srand(924653523);
  long long n;
  cin >> n;
  set<set<long long>> cnt;
  for (long long i = 0; i < n; i++) {
    string s;
    cin >> s;
    set<long long> a;
    a.clear();
    for (auto c : s) {
      a.insert(c);
    }
    cnt.insert(a);
  }
  cout << cnt.size() << "\n";
}
