#include <bits/stdc++.h>
using namespace std;
string s[1005];
set<string> st;
int main() {
  int n;
  cin >> n;
  string::iterator newend;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    sort(s[i].begin(), s[i].end());
    newend = unique(s[i].begin(), s[i].end());
    s[i].erase(newend, s[i].end());
    st.insert(s[i]);
  }
  cout << st.size() << endl;
  return 0;
}
