#include <bits/stdc++.h>
using namespace std;
string parse_word(const string& s) {
  string s1;
  if (s[0] == 'u') {
    s1 = "oo";
  } else {
    s1 = "";
    s1.push_back(s[0]);
  }
  for (int i = 1; i < int(s.size()); ++i) {
    if (s[i] == 'u') {
      s1 += "oo";
    } else if (s[i] == 'h') {
      while (s1.size() != 0 && s1.back() == 'k') s1.pop_back();
      s1.push_back(s[i]);
    } else {
      s1 += s[i];
    }
  }
  return s1;
}
int main() {
  int n = 0;
  cin >> n;
  set<string> ans;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    ans.insert(parse_word(s));
  }
  cout << int(ans.size()) << endl;
  return 0;
}
