#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, ans = 0;
  cin >> n;
  unordered_map<string, int> p;
  while (n--) {
    string s, c;
    cin >> s;
    char a[40] = {'\0'};
    int l = s.length(), j = 0, k = 0;
    for (int i = 0; i < l; i++) {
      if (s[i] == 'u') {
        a[j] = 'o';
        j++;
        a[j] = 'o';
        k = 0;
        j++;
      } else if (i < l - 1 && s[i] == 'k' && s[i + 1] == 'h') {
        j = j - k;
        i++;
        a[j] = 'h';
        j++;
        k = 0;
      } else {
        if (s[i] == 'k')
          k++;
        else
          k = 0;
        a[j] = s[i];
        j++;
      }
    }
    a[j] = '\0';
    if (!p.count(a)) {
      p[a] = 1;
      ans++;
    }
  }
  cout << ans << endl;
  return 0;
}
