#include <bits/stdc++.h>
using namespace std;
const int maxn = 400;
map<string, int> mp;
char str[50];
int main() {
  mp.clear();
  int n;
  scanf("%d", &n);
  for (int k = 0; k < n; k++) {
    string tmp = "";
    scanf("%s", str);
    int len = strlen(str);
    for (int i = len - 1; i >= 0; i--) {
      if (str[i] == 'h') {
        while (i - 1 >= 0 && str[i - 1] == 'k') {
          str[i - 1] = 'A';
          i = i - 1;
        }
      }
    }
    for (int i = 0; i < len; i++) {
      if (str[i] == 'u') {
        tmp += 'o';
        tmp += 'o';
        continue;
      }
      if (str[i] != 'A') tmp += str[i];
    }
    tmp += '\0';
    mp[tmp] = 1;
  }
  printf("%d\n", mp.size());
  return 0;
}
