#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const double EPS = 1e-9;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  set<string> se;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    string ns;
    int sz = s.size();
    for (int i = sz - 1; i >= 0; i--) {
      if (s[i] == 'h') {
        i--;
        while (s[i] == 'k') i--;
        i++;
        ns.push_back('h');
      } else if (s[i] == 'u') {
        ns.push_back('o');
        ns.push_back('o');
      } else
        ns.push_back(s[i]);
    }
    se.insert(ns);
  }
  cout << se.size() << "\n";
  return 0;
}
