#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n;
  cin >> n;
  set<string> st;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    string s2 = "";
    for (int i = 0; i < s.size(); ++i) {
      if (s[i] == 'u') {
        s2 += "oo";
      } else {
        s2 += s[i];
      }
    }
    stack<char> stk;
    for (int i = 0; i < s2.size(); ++i) {
      if (s2[i] == 'h') {
        while (!stk.empty() && stk.top() == 'k') stk.pop();
      }
      stk.push(s2[i]);
    }
    string s3 = "";
    while (!stk.empty()) {
      s3 += stk.top();
      stk.pop();
    }
    reverse(s3.begin(), s3.end());
    st.insert(s3);
  }
  cout << st.size() << endl;
  return 0;
}
