#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  map<string, int> m;
  scanf("%d", &n);
  int ans = 0;
  while (n--) {
    string s, s2;
    cin >> s;
    int flag = 1;
    while (flag) {
      flag = 0;
      for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'u') {
          s2 += "oo";
          flag = 1;
        } else if (s[i] == 'k' && i + 1 < s.size() && s[i + 1] == 'h') {
          s2 += 'h';
          i++;
          flag = 1;
        } else
          s2 += s[i];
      }
      s = s2;
      s2 = "";
    }
    if (m[s] == 0) {
      ans++;
      m[s] = 1;
    }
  }
  cout << ans << endl;
}
