#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, -1, 1, -1, 1};
int dy[] = {-1, 1, 0, 0, 1, 1, -1, -1};
int dz[] = {0, 0, 1, -1, -1, 1, -1, 1};
int isLeft(double a, double b, double c, double d, double e, double f) {
  double r = 0.5 * ((a * (d - f)) + (b * (e - c)) + ((c * f) - (d * e)));
  if (r == 0.00) return 0;
  if (r < 0) return -1;
  return 1;
}
double _distance(double x1, double y1, double x2, double y2) {
  double x1x2 = x1 - x2;
  double y1y2 = y1 - y2;
  return sqrt((x1x2 * x1x2) + (y1y2 * y1y2));
}
bool alpha[27];
int main() {
  int n;
  char word[5000];
  scanf("%d", &n);
  set<string> object;
  while (n--) {
    memset(alpha, false, sizeof(alpha));
    scanf("%s", word);
    string temp;
    for (int i = 0; word[i]; i++) {
      int c = word[i] - 'a';
      if (alpha[c] == false) {
        alpha[c] = true;
        temp += word[i];
        if (temp.size() == 26) break;
      }
    }
    sort(temp.begin(), temp.end());
    if (temp.size()) object.insert(temp);
  }
  cout << object.size() << endl;
  object.clear();
  return 0;
}
