#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 0, 1, -1, 1, 1, -1, -1};
int dy[] = {1, -1, 0, 0, -1, 1, 1, -1};
map<string, int> vis;
int main() {
  int n, ans = 0;
  scanf("%d", &n);
  string s;
  while (n--) {
    cin >> s;
    string nws = "", lasts = "";
    int i = s.length() - 1;
    while (i >= 0) {
      nws = s[i] + nws;
      if (s[i] == 'h') {
        i--;
        while (i >= 0 && s[i] == 'k') i--;
      } else
        i--;
    }
    for (char c : nws) lasts += c == 'u' ? "oo" : string(1, c);
    if (!vis.count(lasts)) ans++, vis[lasts]++;
  }
  printf("%d", ans);
}
