#include <bits/stdc++.h>
using namespace std;
vector<long long> c(long long n) {
  vector<long long> ans;
  for (long long i = 1; i <= sqrt(n); ++i) {
    if (n % i == 0) {
      ans.push_back(i);
      if (n / i != i) {
        ans.push_back(n / i);
      }
    }
  }
  sort(ans.begin(), ans.end());
  return ans;
}
int main() {
  long long n;
  cin >> n;
  vector<string> a(n);
  for (long long i = 0; i < n; ++i) {
    cin >> a[i];
    string s;
    set<char> p;
    for (long long j = 0; j < a[i].size(); ++j) {
      if (p.find(a[i][j]) == p.end()) {
        p.insert(a[i][j]);
      }
    }
    a[i] = "";
    for (auto it : p) {
      a[i].push_back(it);
    }
    while (a[i].size() != 30) {
      a[i].push_back('-');
    }
  }
  sort(a.begin(), a.end());
  set<char> s;
  for (long long i = 0; i < a[0].size(); ++i) {
    s.insert(a[0][i]);
  }
  long long ans = 1;
  for (long long i = 1; i < n; i++) {
    set<char> p;
    long long v = 1;
    for (long long j = 0; j < a[i].size(); ++j) {
      if (s.find(a[i][j]) != s.end() && a[i][j] != '-') {
        v = 0;
      }
    }
    if (v == 0) {
      for (long long j = 0; j < a[i].size(); ++j) {
        s.insert(a[i][j]);
      }
    } else {
      ans += 1;
      for (long long j = 0; j < a[i].size(); ++j) {
        s.insert(a[i][j]);
      }
    }
  }
  cout << ans;
  return 0;
}
