#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> st;
  int ans = 0;
  while (n--) {
    string s;
    cin >> s;
    vector<int> arr(26, 0);
    for (int i = 0; i < s.size(); i++) {
      arr[s[i] - 'a'] = 1;
    }
    string temp = "";
    for (int i = 0; i < 26; i++) {
      if (arr[i] == 1) {
        char ch = i + 'a';
        temp = temp + ch;
      }
    }
    if (st.find(temp) == st.end()) {
      ans++;
      st.insert(temp);
    }
  }
  cout << ans;
}
