#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, sum = 0;
  cin >> n;
  map<string, bool> Map;
  char s[25], tmp[50];
  while (n--) {
    cin >> s;
    int l = strlen(s);
    int index = 0, t = 0;
    while (index < l) {
      if (s[index] == 'u') {
        tmp[t++] = 'o';
        tmp[t++] = 'o';
        index = index + 1;
      } else {
        tmp[t++] = s[index];
        index++;
      }
    }
    for (int i = 0; i < t; i++) s[i] = tmp[i];
    index = t - 1;
    while (index >= 0) {
      if (s[index] == 'h') {
        while (s[index - 1] == 'k' && index - 1 >= 0) {
          s[index - 1] = ' ';
          index--;
        }
        index--;
      } else
        index--;
    }
    string finalString = "";
    for (int i = 0; i < t; i++) {
      if (s[i] == ' ') continue;
      finalString += s[i];
    }
    if (Map[finalString]) continue;
    sum++;
    Map[finalString] = true;
  }
  cout << sum << endl;
  return 0;
}
