#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a;
  char temp;
  vector<string> s;
  for (int i = 0; i < n; i++) {
    cin >> a;
    sort(a.begin(), a.end());
    s.push_back(a);
  }
  cout << endl;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < s[i].length(); j++) {
      for (int k = j + 1; k < s[i].length(); k++) {
        if (s[i][j] == s[i][k]) {
          s[i][k] = '\0';
        }
      }
    }
    s[i].erase(remove(s[i].begin() + 1, s[i].end(), '\0'), s[i].end());
  }
  sort(s.begin(), s.end());
  int j = 0, c = 1;
  for (int i = j + 1; i < n; i++) {
    if (s[j].compare(s[i]) != 0) {
      j = i;
      c++;
    }
  }
  cout << endl << c;
}
