#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:128777216")
using namespace std;
const long double eps = pow(10.0, -10.0);
mt19937 rndm;
void start() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cout.precision(15);
  cout.setf(ios::fixed);
  string FILENAME = "sample";
  rndm.seed(time(0));
}
int main() {
  start();
  int n;
  cin >> n;
  set<set<char>> vals;
  for (int i = 0; i < n; ++i) {
    string a;
    cin >> a;
    set<char> f;
    for (int j = 0; j < a.size(); ++j) f.insert(a[j]);
    vals.insert(f);
  }
  cout << vals.size();
  return 0;
}
