#include <bits/stdc++.h>
using namespace std;
const int MAXL = 25;
int _w;
int n;
char str[MAXL];
set<string> s;
string solve(char *s, int n) {
  string str;
  int cntk = 0;
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'u') {
      for (int t = 0; t < cntk; ++t) str += 'k';
      cntk = 0;
      str += "oo";
    } else if (s[i] == 'k') {
      ++cntk;
    } else if (s[i] == 'h') {
      str += 'h', cntk = 0;
    } else {
      for (int t = 0; t < cntk; ++t) str += 'k';
      cntk = 0;
      str += s[i];
    }
  }
  for (int t = 0; t < cntk; ++t) str += 'k';
  return str;
}
int main() {
  _w = scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    _w = scanf("%s", str);
    int len = (int)strlen(str);
    s.insert(solve(str, len));
  }
  printf("%d\n", (int)s.size());
  return 0;
}
