#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MAX = 10000000000000;
char a[505][505];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  set<set<char>> s;
  while (n--) {
    string s1;
    cin >> s1;
    s.insert(set<char>(s1.begin(), s1.end()));
  }
  cout << s.size();
  return 0;
}
