#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  while (cin >> T) {
    set<string> st;
    while (T--) {
      string s;
      cin >> s;
      int l = s.length();
      for (int i = l; i >= 0; i--) {
        if (s[i] == 'u') s.replace(i, 1, "oo");
        if (s[i] == 'k' && s[i + 1] == 'h') s.replace(i, 2, "h");
      }
      st.insert(s);
    }
    cout << st.size() << endl;
  }
  return 0;
}
