#include <bits/stdc++.h>
using namespace std;
void past_code();
void file() {}
long long gcd(long long x, long long y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}
long long todic(string z) {
  long long sum = 0;
  long long j = 1;
  for (long long i = 0; i < z.length(); i++) {
    sum += (z[i] - '0') * j;
    j *= 2;
  }
  return sum;
}
string tobin(long long a) {
  string x;
  while (a != 0) {
    x += to_string(a % 2);
    a /= 2;
  }
  return x;
}
bool isPrime(long long n) {
  if (n <= 1) return false;
  for (long long i = 2; i <= sqrt(n); i++)
    if (n % i == 0) return false;
  return true;
}
string towlo(string x) {
  string h;
  for (long long i = 0; i < x.length(); i++) {
    h += tolower(x[i]);
  }
  return h;
}
bool comp(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second > b.second;
}
inline void read(int &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = 10 * x + c - '0';
    c = getchar();
  }
  x *= f;
}
long long fact(long long o) {
  if (o == 0) return 1;
  return o * fact(o - 1);
}
long long sumd(long long x) {
  long long sum = 0;
  while (x != 0) {
    sum += x % 10;
    x /= 10;
  }
  return sum;
}
bool com(pair<long long, long long> a, pair<long long, long long> b) {
  return a.second > b.second;
}
int arr[10005];
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int x;
  cin >> x;
  set<char> sc;
  set<string> ss;
  for (int i = 0; i < x; i++) {
    string s;
    cin >> s;
    for (int j = 0; j < s.length(); j++) {
      sc.insert(s[j]);
    }
    vector<char> k(sc.begin(), sc.end());
    string h(k.begin(), k.end());
    ss.insert(h);
    sc.clear();
  }
  cout << ss.size() << '\n';
  return 0;
}
