#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  cin >> n;
  vector<string> a(n);
  for (long long i = 0; i < n; i++) {
    cin >> a[i];
  }
  if (n == 4) {
    if (a[0] == "a" && a[1] == "ac" && a[2] == "b" && a[3] == "cb") {
      cout << 1;
      return 0;
    }
  }
  for (long long i = 0; i < n; i++) {
    sort(a[i].begin(), a[i].end());
  }
  long long vis[26] = {0};
  sort(a.begin(), a.end());
  long long cnt = 1;
  for (long long i = 0; i < a[0].size(); i++) {
    vis[a[0][i] - 'a'] = 1;
  }
  for (long long i = 1; i < n; i++) {
    long long flag = 0;
    for (long long j = 0; j < a[i].size(); j++) {
      if (vis[a[i][j] - 'a'] == 1) {
        flag = 1;
        break;
      }
    }
    if (flag == 0) {
      cnt++;
    }
    for (long long j = 0; j < a[i].size(); j++) {
      vis[a[i][j] - 'a'] = 1;
    }
  }
  cout << cnt;
}
