#include <bits/stdc++.h>
using namespace std;
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  t = 1;
  while (t--) {
    long long n;
    cin >> n;
    set<string> s;
    string a;
    for (auto i = 0; i < n; i++) {
      cin >> a;
      long long j = a.length();
      j -= 2;
      if (a[j + 1] == 'u') {
        a.replace(j + 1, 1, "oo");
      }
      for (; j >= 0; j--) {
        if (a[j + 1] == 'h' && a[j] == 'k') {
          a.replace(j, 2, "h");
        } else if (a[j] == 'u') {
          a.replace(j, 1, "oo");
        }
      }
      s.insert(a);
    }
    cout << s.size();
  }
}
