#include <bits/stdc++.h>
using namespace std;
template <typename T>
void print_array(T* arr, int num) {
  for (int(i) = (0); (i) < (num); (i)++) cout << arr[i] << ' ';
  cout << '\n';
}
template <typename T>
void print_vector(vector<T> vec) {
  for (int(i) = (0); (i) < (vec.size()); (i)++) cout << vec[i] << ' ';
  cout << '\n';
}
void setIO() {}
int n;
string s;
unordered_set<string> st;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  setIO();
  cin >> n;
  int ans = 0;
  for (int(i) = (0); (i) < (n); (i)++) {
    cin >> s;
    string ns = "";
    for (int(j) = (0); (j) < (s.length()); (j)++) {
      if (s[j] == 'u') {
        ns += "oo";
      } else
        ns += s[j];
    }
    while (ns.find("kh") < ns.size()) {
      ns.replace(ns.find("kh"), 2, "h");
    }
    if (st.find(ns) == st.end()) {
      ans++;
      st.insert(ns);
    }
  }
  cout << ans;
}
