#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const int INF = 1e9;
int n;
vector<int> a;
template <typename T>
istream &operator>>(istream &in, vector<T> &a) {
  for (auto &i : a) in >> i;
  return in;
}
template <typename T>
ostream &operator<<(ostream &out, vector<T> a) {
  for (auto i : a) out << i << " ";
  return out;
}
template <typename T>
void print(ostream &out, vector<T> a, string sep = " ") {
  for (auto i : a) out << i << sep;
}
void print_solution(int l, int r) {}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  set<set<char>> c;
  string s, mus;
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    set<char> f;
    for (auto &j : s) f.insert(j);
    c.insert(f);
  }
  cout << c.size();
  return 0;
}
