#include <bits/stdc++.h>
using namespace std;
const int maxn = 100055;
int main() {
  ios::sync_with_stdio(0);
  vector<char> v;
  map<vector<char>, int> Map;
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < (n); ++i) {
    cin >> s;
    v.clear();
    for (int i = 0; i < (s.length()); ++i) v.push_back(s[i]);
    sort(v.begin(), v.end());
    v.erase(unique(v.begin(), v.end()), v.end());
    Map[v] = 1;
  }
  cout << Map.size() << endl;
  return 0;
}
