#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int k, n, m, x, ans;
int a[N];
string second, r;
map<string, int> vis1, vis2;
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    char e[50];
    scanf("%s", e);
    r = second = e;
    while (second.find("kh") != -1) {
      x = second.find("kh");
      second.erase(second.begin() + x);
    }
    r = second;
    while (second.find("oo") != -1) {
      x = second.find("oo");
      second[x] = 'u';
      second.erase(second.begin() + x + 1);
    }
    while (r.find("u") != -1) {
      x = r.find("u");
      r[x] = 'o';
      r.insert(r.begin() + x, 'o');
    }
    vis1[second] = 1;
    vis2[r] = 1;
  }
  printf("%d\n", min(vis1.size(), vis2.size()));
  return 0;
}
