#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string a[n];
  unsigned int j, l;
  int i;
  for (i = 0; i < n; i++) cin >> a[i];
  for (i = 0; i < n; i++) {
    while (1) {
      if (a[i].find("u") != string::npos) {
        j = a[i].find("u");
        a[i].replace(j, 1, "oo");
      }
      if (a[i].find("kh") != string::npos) {
        l = a[i].find("kh");
        a[i].replace(l, 2, "h");
      }
      if (a[i].find("u") == string::npos && a[i].find("kh") == string::npos)
        break;
    }
  }
  vector<string> v(n);
  for (i = 0; i < n; i++) v[i] = a[i];
  sort(v.begin(), v.end());
  v.erase(unique(v.begin(), v.end()), v.end());
  cout << v.size();
}
