#include <bits/stdc++.h>
using namespace std;
string Find(string s) {
  while (s.find("kh") < s.size()) s.replace(s.find("kh"), 2, "h");
  while (s.find("u") < s.size()) s.replace(s.find("u"), 1, "oo");
  return s;
}
int main() {
  string s;
  map<string, long long> ismap;
  long long n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    ismap[Find(s)]++;
  }
  cout << ismap.size();
  return 0;
}
