#include <bits/stdc++.h>
using namespace std;
map<string, int> m;
int vis[1010];
int main() {
  int n, ans = 0;
  string s, b;
  cin >> n;
  while (n--) {
    memset(vis, 0, sizeof(vis));
    cin >> s;
    b.clear();
    sort(s.begin(), s.end());
    for (int i = 0; i < s.size(); i++)
      if (s[i] == s[i + 1]) vis[i] = 1;
    for (int i = 0; i < s.size(); i++)
      if (!vis[i]) b += s[i];
    if (!m[b]) ans++;
    m[b] = 1;
  }
  cout << ans << endl;
  return 0;
}
