#include <bits/stdc++.h>
using namespace std;
map<int, int> dd;
int n, res;
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    int cur = 0;
    for (int j = 0; j < s.size(); j++) cur |= (1 << (s[j] - '0'));
    if (dd[cur] == 0) res++;
    dd[cur] = 1;
  }
  cout << res;
}
