#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  set<string> st;
  string s, t, t1;
  cin >> n;
  while (n--) {
    cin >> s;
    t = s;
    for (int i = 0; i < s.size(); i++) {
      if (s[i] == 'u') {
        t = t1 = "";
        t.assign(s, 0, max(0, i));
        t1.assign(s, min(i + 1, (int)s.size()), s.size() - i);
        t += "oo";
        t += t1;
      }
      s = t;
    }
    for (int k = 0; k < 20; k++) {
      for (int i = 0; i < s.size() - 1; i++) {
        if (s[i] == 'k' and s[i + 1] == 'h') s.erase(i, 1);
      }
      t = s;
    }
    st.insert(t);
  }
  cout << st.size();
}
