#include <bits/stdc++.h>
using namespace std;
string s;
int n;
bool kt[1001], a[1001][27];
;
int main() {
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> s;
    for (int j = 0; j < s.length(); ++j) a[i][s[j] - 'a'] = true;
  }
  for (int i = 2; i <= n; ++i) {
    for (int j = 1; j < i; ++j) {
      if (kt[j] == false) {
        bool k = true;
        for (int z = 0; z <= 'z' - 'a'; ++z)
          if (a[i][z] != a[j][z]) {
            k = false;
            break;
          }
        if (k) {
          kt[i] = true;
          break;
        }
      }
    }
  }
  int kq = 0;
  for (int i = 1; i <= n; ++i)
    if (kt[i] == false) ++kq;
  cout << kq;
  return 0;
}
