#include <bits/stdc++.h>
using namespace std;
using lli = long long int;
using pii = pair<int, int>;
using vi = vector<int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vlli = vector<long long int>;
using vpii = vector<pair<int, int>>;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int n;
  string s, r;
  cin >> n;
  set<string> a;
  for (int i = 0; i < n; i++) {
    cin >> s;
    r = "";
    sort((s).begin(), (s).end());
    r += s[0];
    for (int j = 1; j < s.length(); j++)
      if (s[j] != s[j - 1]) r += s[j];
    a.insert(r);
  }
  cout << a.size();
}
