#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
string st, st1;
int main() {
  int n, m, ans;
  ans = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    cin >> st;
    sort(st.begin(), st.end());
    st1 = "";
    st1 += st[0];
    for (int i = 1; i <= st.size() - 1; i++) {
      if (st[i] != st[i - 1]) st1 += st[i];
    }
    if (mp[st1] == 0) ans += 1;
    mp[st1] = 1;
  }
  printf("%d\n", ans);
  return 0;
}
