#include <bits/stdc++.h>
using namespace std;
int arr[1000005];
void solve(long long int x) {}
vector<int> v[200005];
int main() {
  int n, ans = 0;
  cin >> n;
  string s;
  set<string> ms;
  for (int i = 0; i < n; i++) {
    int cnt[26] = {0};
    string temp;
    cin >> s;
    int flag = 0;
    for (int i = 0; i < s.length(); i++) {
      cnt[s[i] - 97]++;
    }
    for (int i = 0; i < 26; i++) {
      if (cnt[i] > 0) {
        temp += (char)(i + 97);
      }
    }
    ms.insert(temp);
  }
  cout << ms.size();
  return 0;
}
