#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a[1001], b[1001];
  int size, answer = 0;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    sort(a[i].begin(), a[i].end());
    size = a[i].size();
    a[i].erase(unique(a[i].begin(), a[i].end()), a[i].end());
  }
  sort(a, a + n);
  for (int i = 0; i < n; i++) {
    if (i != n - 1 && a[i] != a[i + 1]) {
      answer++;
    } else if (i == n - 1 && a[i] != a[i + 1]) {
      answer++;
    }
  }
  cout << answer;
  return 0;
}
