#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cout.precision(10);
  int n;
  cin >> n;
  set<string> st;
  while (n--) {
    string s, ss;
    cin >> s;
    for (int i = s.size() - 1; i >= 0; i--) {
      if (s[i] == 'u') {
        ss += "oo";
      } else if (s[i] == 'h') {
        ss += 'h';
        while (i > 0 && s[i - 1] == 'k') {
          i--;
        }
      } else {
        ss += s[i];
      }
    }
    reverse(ss.begin(), ss.end());
    st.insert(ss);
  }
  cout << st.size() << "\n";
  return 0;
}
