#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TESTS = 1;
  while (TESTS--) {
    int n;
    cin >> n;
    vector<long long int> v;
    int y;
    int flg = 0;
    string temp;
    for (long long int i = 0; i < n; i++) {
      string s;
      cin >> s;
      temp = "00000000000000000000000000";
      for (long long int j = 0; j < s.size(); j++) {
        temp[s[j] - 'a'] = '1';
      }
      int tno = 0;
      for (int h = 0; h < 26; h++) {
        tno += (temp[h] - '0') * pow(2, h);
      }
      for (long long int k = 0; k < v.size(); k++) {
        if (tno & v[k]) {
          tno = v[k] | tno;
          v.erase(v.begin() + k);
          k--;
        }
      }
      v.push_back(tno);
    }
    cout << v.size();
  }
  return 0;
}
