#include <bits/stdc++.h>
using namespace std;
map<string, int> ma;
int main() {
  string str;
  char st[100];
  char cnt[100];
  int top = 0;
  int n;
  cin >> n;
  int sum = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%s", st);
    int len = strlen(st);
    str.clear();
    top = 0;
    for (int i = 0; i < len; ++i) {
      if (st[i] == 'u') {
        st[i] = 'U';
      } else if (st[i] == 'h') {
        int j = i - 1;
        while (j >= 0 && st[j] == 'k') {
          st[j] = '$';
          j--;
        }
      }
    }
    for (int i = 0; i < len; ++i) {
      if (st[i] != '$') {
        if (st[i] == 'U') {
          str.push_back('o');
          str.push_back('o');
        } else
          str.push_back(st[i]);
      }
    }
    if (ma.find(str) == ma.end()) {
      sum++;
      ma[str] = 1;
    }
  }
  cout << sum << endl;
  return 0;
}
