#include <bits/stdc++.h>
using namespace std;
vector<char> v;
set<char> st;
set<string> e;
string a[1001], b[1001];
int x = 0;
void f(string s) {
  char c = s[0];
  v.push_back(c);
  for (int j = 1; j < s.size(); j++) {
    if (s[j] != c) {
      c = s[j];
      v.push_back(c);
    }
  }
  string y = "";
  int sz = v.size();
  for (int i = sz - 1; i >= 0; i--) {
    c = v[i];
    y += c;
    v.pop_back();
  }
  b[x] = y;
}
int main() {
  int n;
  cin >> n;
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    sort(s.begin(), s.end());
    f(s);
    x++;
  }
  for (int i = 0; i < n; i++) {
    e.insert(b[i]);
  }
  cout << e.size() << endl;
  return 0;
}
