#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  string s[n];
  for (int i = 0; i < n; i++) cin >> s[i];
  for (int i = 0; i < n; i++) {
    while (1) {
      int fl = 0;
      string pt;
      for (int j = 0; j < s[i].length(); j++) {
        if (s[i][j] == 'k' && s[i][j + 1] == 'h') {
          fl = 1;
          pt += "h";
          j++;
        } else if (s[i][j] == 'u') {
          fl = 1;
          pt += "oo";
        } else {
          pt += s[i][j];
        }
      }
      s[i] = pt;
      if (fl == 0) break;
    }
  }
  set<string> str;
  for (int i = 0; i < n; i++) str.insert(s[i]);
  cout << str.size() << '\n';
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
