#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  set<string> st;
  for (int i = int(0); i < int(n); ++i) {
    string s;
    cin >> s;
    vector<int> to_erase;
    for (int j = int(s.size() - 1); j >= int(1); --j) {
      if (s[j] == 'h') {
        for (int k = int(j - 1); k >= int(0); --k) {
          if (s[k] == 'k')
            to_erase.push_back(k);
          else
            break;
        }
      }
    }
    for (int j = int(0); j < int(to_erase.size()); ++j) {
      s.erase(s.begin() + to_erase[j]);
    }
    string aux = "";
    for (int j = int(0); j < int(s.size()); ++j) {
      if (s[j] == 'u') {
        aux += "oo";
      } else
        aux += s[j];
    }
    st.insert(aux);
  }
  cout << st.size() << endl;
  return 0;
}
