#include <bits/stdc++.h>
using namespace std;
const int maxn = int(1e3 + 5);
vector<string> words(maxn);
set<set<char> > q;
map<set<char>, int> dict;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> words[i];
    set<char> curr;
    bool correct = true;
    for (int j = 0; j < words[i].size(); j++) curr.insert(words[i][j]);
    if (correct) q.insert(curr);
  }
  int indx = 1;
  for (auto it : q) {
    dict[it] = indx;
    indx++;
  }
  set<int> ans;
  for (int i = 0; i < n; i++) {
    set<char> curr;
    for (int j = 0; j < words[i].size(); j++) curr.insert(words[i][j]);
    ans.insert(dict[curr]);
  }
  ans.erase(0);
  cout << ans.size();
}
