#include <bits/stdc++.h>
using namespace std;
int main() {
  vector<string> v;
  string arr[1000];
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    sort(arr[i].begin(), arr[i].end());
    arr[i].resize(unique(arr[i].begin(), arr[i].end()) - arr[i].begin());
    v.push_back(arr[i]);
  }
  sort(v.begin(), v.end());
  v.resize(unique(v.begin(), v.end()) - v.begin());
  cout << v.size();
  return 0;
}
