#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long lcm(long long fir, long long sec) {
  return (fir * sec) / (gcd(fir, sec));
}
long long modularExponentiation(long long x, long long n, long long M) {
  if (n == 0)
    return 1;
  else if (n % 2 == 0)
    return modularExponentiation((x * x) % M, n / 2, M);
  else
    return (x * modularExponentiation((x * x) % M, (n - 1) / 2, M)) % M;
}
long long mult(long long a, long long b, long long M) {
  return ((a % M * b % M) % M);
}
const int MOD = 1e9 + 7;
const string small_alphabets = "abcdefghijklmnopqrstuvwxyz";
const int month_days[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
int main() {
  int n;
  cin >> n;
  string s;
  set<string> answer;
  for (int i = 0; i < n; ++i) {
    set<char> st;
    cin >> s;
    for (int i = 0; i < s.size(); ++i) {
      st.insert(s[i]);
    }
    string ans = "";
    for (typeof(st.begin()) ite = st.begin(); ite != st.end(); ite++) {
      ans += *ite;
    }
    answer.insert(ans);
  }
  cout << answer.size() << endl;
  return 0;
}
