#include <bits/stdc++.h>
using namespace std;
bool a[1100][26];
vector<bool> v(1100, false);
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (auto c : s) a[i][c - 97] = true;
  }
  for (int i = 0; i < n; i++) {
    if (v[i]) continue;
    for (int j = i + 1; j < n; j++) {
      bool b = true;
      for (int g = 0; g < 26; g++)
        if (a[i][g] != a[j][g]) b = false;
      if (b) {
        v[j] = true;
      }
    }
  }
  int ans = 0;
  for (int i = 0; i < n; i++)
    if (!v[i]) ans++;
  cout << ans;
  return 0;
}
