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