#include <bits/stdc++.h>
using namespace std;
int main() {
  std::ios_base::sync_with_stdio(false), std::cin.tie(NULL),
      std::cout.tie(NULL);
  set<string> table;
  bool used[26];
  long long n;
  cin >> n;
  for (long long i = 0; i < n; i++) {
    memset(used, 0, sizeof(used));
    string tmp;
    cin >> tmp;
    string str;
    for (long long i = 0; i < tmp.size(); i++)
      if (!used[tmp[i] - 'a']) {
        used[tmp[i] - 'a'] = true;
        str.push_back(tmp[i]);
      }
    sort(str.begin(), str.end());
    table.insert(str);
  }
  cout << table.size() << endl;
  return 0;
}
