#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, i, j;
  cin >> n;
  string p = "";
  vector<string> s(n);
  for (i = 0; i < n; i++) cin >> s[i];
  for (j = 0; j < n; j++) {
    p = s[j];
    if (p == "u") p = "oo";
    for (i = 1; i < p.length(); i++) {
      if (p[i - 1] == 'u') {
        p = p.substr(0, i - 1) + "oo" + p.substr(i, p.length());
      }
      if (p[p.length() - 1] == 'u') p = p.substr(0, p.length() - 1) + "oo";
      if (p[i - 1] == 'k' && p[i] == 'h') {
        p = p.substr(0, i - 1) + p.substr(i, p.length());
        i = 0;
      }
    }
    s[j] = p;
    p = "";
  }
  sort(s.begin(), s.end());
  s.erase(unique(s.begin(), s.end()), s.end());
  cout << s.size();
  return 0;
}
