#include <bits/stdc++.h>
using namespace std;
const int N = 100002;
int n;
string a;
set<int> second;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    cin >> a;
    int x = 0;
    for (char c : a) x |= 1 << (c - 'a');
    second.insert(x);
  }
  cout << ((int)(second).size());
}
