#include <bits/stdc++.h>
using namespace std;
int n;
string input, tmp;
set<string> words;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    sort(input.begin(), input.end());
    string tmp = "";
    for (int j = 0; j < input.size(); j++)
      if (input[j] != input[j + 1]) tmp += input[j];
    words.insert(tmp);
  }
  cout << words.size() << "\n";
  return 0;
}
