#include <bits/stdc++.h>
using namespace std;
int main() {
  set<string> S;
  long n;
  string a;
  cin >> n;
  for (long i = 0; i < n; i++) {
    cin >> a;
    string s = "";
    long j = 0;
    while (j < a.size()) {
      if (a[j] == 'k') {
        long k = j;
        while (a[k] == 'k') k++;
        if (a[k] == 'h') {
          j = k;
          s = s + "kh";
        } else {
          s.push_back(a[j]);
        }
      } else if (a[j] == 'u') {
        s = s + "oo";
      } else if (a[j] == 'h') {
        s = s + "kh";
      } else {
        s.push_back(a[j]);
      }
      j++;
    }
    S.insert(s);
  }
  cout << S.size();
}
