#include <bits/stdc++.h>
using namespace std;
const int siz = 1e5 + 10;
const long long modu = 1e9 + 7;
int main() {
  int n;
  string s;
  scanf("%d", &n);
  set<string> dis;
  for (int i = 0; i < n; i++) {
    string s1;
    cin >> s;
    int len = s.size();
    for (int j = len - 1; j >= 0; j--) {
      if (s[j] == 'h') {
        s1 += s[j--];
        while (s[j] == 'k' && j >= 0) j--;
        j++;
      } else if (s[j] == 'u')
        s1 += "oo";
      else
        s1 += s[j];
    }
    dis.insert(s1);
  }
  int ans = dis.size();
  printf("%d\n", ans);
  return 0;
}
