#include <bits/stdc++.h>
using namespace std;
int n, cnt;
string s;
set<int> a;
int main() {
  for (cin >> n; n--;) {
    cin >> s;
    cnt = 0;
    for (auto& x : s) cnt |= 1 << (x - 'a');
    a.insert(cnt);
  }
  cout << a.size() << endl;
}
