#include <bits/stdc++.h>
using namespace std;
map<pair<char, char>, char> conversions;
string shorten(string &str) {
  string s;
  for (auto &c : str) {
    s.push_back(c);
    while (s.size() >= 1) {
      if (s[s.size() - 1] == 'u') {
        s.pop_back();
        s.push_back('o');
        s.push_back('o');
      } else if (s.size() >= 2 && s[s.size() - 2] == 'k' &&
                 s[s.size() - 1] == 'h') {
        s.pop_back();
        s.pop_back();
        s.push_back('h');
      } else {
        break;
      }
    }
  }
  return s;
}
int main() {
  conversions[{'o', 'o'}] = 'u';
  conversions[{'k', 'h'}] = 'h';
  int n;
  set<string> all_names;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string cur_name;
    cin >> cur_name;
    all_names.insert(shorten(cur_name));
  }
  cout << all_names.size() << endl;
  return 0;
}
