#include <bits/stdc++.h>
using namespace std;
int main(int argc, char *argv[]) {
  ios_base::sync_with_stdio(false);
  int N;
  cin >> N;
  set<set<char>> res;
  for (int i = 0; i < N; ++i) {
    string str;
    cin >> str;
    res.emplace(begin(str), end(str));
  }
  cout << res.size() << endl;
  return 0;
}
