#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  vector<string> v;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    string s1;
    for (int j = s.size() - 1; j >= 0; --j) {
      if (s[j] == 'h') {
        s1 += 'h';
        j--;
        while (s[j] == 'k') j--;
        ++j;
      } else if (s[j] == 'u')
        s1 += "oo";
      else
        s1 += s[j];
    }
    v.push_back(s1);
  }
  for (int i = 0; i < v.size() - 1; ++i)
    for (int j = i + 1; j < v.size(); ++j)
      if (v[i] == v[j]) {
        v.erase(v.begin() + j);
        j--;
      }
  cout << v.size();
  return 0;
}
