#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n;
  cin >> n;
  set<vector<long long int> > se;
  for (long long int i = (long long int)1; i <= (long long int)n; i++) {
    string s;
    cin >> s;
    vector<long long int> v(26, 0);
    for (auto x : s) v[x - 'a'] = 1;
    se.insert(v);
  }
  cout << se.size() << "\n";
}
