#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> unique;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    for (;;) {
      bool found = false;
      if (s == "u") s = "oo";
      for (int j = 0; j < s.length() - 1; j++) {
        if (s.at(j) == 'k' and s.at(j + 1) == 'h') {
          s.erase(j, 1);
          found = true;
          j -= 2;
          if (j == -2) j++;
          break;
        } else if (s.at(j) == 'u') {
          s.erase(j, 1);
          s.insert(s.begin() + j, 'o');
          s.insert(s.begin() + j, 'o');
          found = true;
          break;
        } else if (s.at(j + 1) == 'u') {
          s.erase(j + 1, 1);
          s.insert(s.begin() + j + 1, 'o');
          s.insert(s.begin() + j + 1, 'o');
          found = true;
          break;
        }
      }
      if (!found) break;
    }
    unique.insert(s);
  }
  cout << unique.size() << endl;
  return 0;
}
