#include <bits/stdc++.h>
using namespace std;
template <class T>
void test(T a) {
  cout << a << endl;
}
template <class T, class T2>
void test(T a, T2 b) {
  cout << a << " " << b << endl;
}
template <class T, class T2, class T3>
void test(T a, T2 b, T3 c) {
  cout << a << " " << b << " " << c << endl;
}
const int maxn = 2e5;
const int inf = 0x3f3f3f3f;
const long long INF = 0x3f3f3f3f3f3f3f3fll;
const long long mod = (long long)1e9 + 7 + 1e8;
int T;
void testcase() { printf("Case #%d: ", ++T); }
set<int> s;
char str[10000];
void work() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < (n); i++) {
    scanf("%s", str);
    int len = strlen(str);
    int su = 0;
    for (int i = 0; i < len; i++) su |= (1 << (str[i] - 'a'));
    s.insert(su);
  }
  printf("%d\n", s.size());
}
int main() {
  int t = 1;
  while (t--) work();
}
