#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, ans, vis[N], come[N], cnt[N][50];
char s[N];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", s + 1);
    int len = strlen(s + 1);
    sort(s + 1, s + 1 + len);
    for (int j = 1; j <= len; j++) cnt[i][s[j] - 'a'] = 1;
  }
  for (int i = 1; i <= n; i++)
    for (int j = i + 1; j <= n; j++) {
      if (vis[j]) continue;
      bool flag = 1;
      for (int k = 0; k < 26; k++)
        if (cnt[i][k] != cnt[j][k]) flag = 0;
      if (flag == 1) vis[j] = 1;
    }
  for (int i = 1; i <= n; i++) ans += vis[i];
  printf("%d\n", n - ans);
  return 0;
}
