#include <bits/stdc++.h>
using namespace std;
int n;
string input, tmp;
set<string> words;
bool used[1005];
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> input;
    tmp = "";
    memset(used, false, sizeof(used));
    for (int j = 0; j < input.size(); j++) used[input[j] - 'a'] = true;
    for (int j = 0; j < 26; j++)
      if (used[j]) tmp += char(j + 'a');
    words.insert(tmp);
  }
  cout << words.size() << "\n";
  return 0;
}
