#include <bits/stdc++.h>
using namespace std;
string sol(string a) {
  int l = a.length();
  for (int i = 0; i < l; i++) {
    if (a[i] == 'u') return sol(a.replace(i, 1, "oo"));
    if (a[i] == 'k' && a[i + 1] == 'h') return sol(a.erase(i, 1));
  }
  return a;
}
int main() {
  int n;
  cin >> n;
  string a[n];
  set<string> ans;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    string p = sol(a[i]);
    ans.insert(p);
  }
  cout << ans.size();
}
