#include <bits/stdc++.h>
using namespace std;
const int N = 1100;
const int M = 256;
const int K = 26;
const int INF = 2000000000;
const double eps = 1e-12;
int k, m, n, d[K], a[N];
char s[N];
bool ok;
int F();
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
  k = 1;
  for (int i = 0; i < 26; i++) d[i] = k, k <<= 1;
  for (int i = 0; i < n; i++) {
    cin >> s;
    m = 0;
    for (int j = 0; s[j]; j++) m = m | d[s[j] - 'a'];
    a[i] = m;
  }
  sort(a, a + n);
  m = 1;
  for (int i = 1; i < n; i++)
    if (a[i] != a[i - 1]) m++;
  cout << m;
  return 0;
}
int F() { return 0; }
