#include <bits/stdc++.h>
using namespace std;
int Y[] = {-1, 1, 0, 0, -1, -1, 1, 1};
int X[] = {0, 0, -1, 1, -1, 1, -1, 1};
int DIR4 = 4;
int DIR8 = 8;
long long power(long long a, long long n) {
  if (a == 0) return 0;
  if (a == 1 || n == 0) return 1;
  if (n == 1) return a % 1000000007;
  long long t = power(a, n / 2);
  t = t * t % 1000000007;
  if (n & 1) return t * a % 1000000007;
  return t;
}
void keywordsForAutocompletion() {}
int popcount(long long a) {
  int c = 0;
  while (a) {
    c++;
    a -= a & -a;
  }
  return c;
}
void factorize(int a) {}
void update(int tree[], int idx, int val, int maxval) {
  for (; idx <= maxval; idx += idx & -idx) {
    tree[idx] += val;
  }
}
int read(int tree[], int idx) {
  long long sum = 0;
  for (; idx > 0; idx -= idx & -idx) {
    sum += tree[idx];
  }
  return sum;
}
struct node2 {
  int id, val;
  node2() {
    static int ctx = 1;
    id = ctx++;
  };
  node2(int a, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0) {
    val = a;
  }
};
struct comp2 {
  bool operator()(int a, int b) { return b < a; }
};
bool cmp2(int a, int b) { return b < a; }
struct node {
  int id, val;
  node() {
    static int ctx = 1;
    id = ctx++;
  };
  node(int a, int b = 0, int c = 0, int d = 0, int e = 0, int f = 0) {
    val = a;
  }
};
struct comp {
  bool operator()(int a, int b) { return b < a; }
};
bool cmp(int a, int b) { return b < a; }
int n, m, a, b, c, d, k, h, w, x, y, p, q, t, ans, res, ma, mi, T,
    act = 0, pas = 1, cur, flag, now;
int uu, vv, ww, l, r;
int dp, dp2, cnt, sum, sub, sz, lim, tmp, type, add;
char s[100009], ch;
double f, z, e;
vector<int> v, vec;
set<int> sett;
map<string, int> mapp;
void print() {}
void print2() {}
void input() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n;
}
void inity() {}
void solve() {
  string s;
  for (int i = 0; i < n; i++) {
    cin >> s;
    bool h[30] = {0};
    for (int i = 0; i < s.length(); i++) {
      h[s[i] - 'a'] = 1;
    }
    char t[30] = {0};
    int k = 0;
    for (int i = 0; i < 26; i++)
      if (h[i]) t[k++] = 'a' + i;
    mapp[string(t)] = 1;
  }
}
void output() { cout << mapp.size(); }
int main() {
  input();
  solve();
  output();
  return 0;
}
