#include <bits/stdc++.h>
using namespace std;
const long long Llinf = LLONG_MAX;
const int Inf = INT_MAX;
const int Maxn = 400 + 10;
const int Mod = 1e9 + 7;
char* _c = new char[Maxn];
string GetString() {
  scanf("%s", _c);
  return string(_c);
}
int n;
string s[Maxn];
string ns[Maxn];
unordered_map<string, bool> m;
int ans;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) s[i] = GetString();
  for (int i = 0; i < n; i++)
    for (int j = 0; j < s[i].size(); j++) {
      if (s[i][j] == 'u') s[i][j] = 'o', s[i].insert(j + 1, "o");
      if (s[i][j] == 'h') {
        int k = j - 1;
        while (k >= 0 && s[i][k] == 'k') s[i][k] = '.', k--;
      }
    }
  for (int i = 0; i < n; i++)
    for (int j = 0; j < s[i].size(); j++)
      if (s[i][j] != '.') ns[i].push_back(s[i][j]);
  for (int i = 0; i < n; i++)
    if (!m[ns[i]]) ans++, m[ns[i]] = true;
  printf("%d\n", ans);
  return 0;
}
