#include <bits/stdc++.h>
using namespace std;
int n;
char a[100];
long long x[500];
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", a + 1);
    x[i] = 0;
    int len = strlen(a + 1), sum = 0;
    for (int j = 1; j <= len; j++)
      if (a[j] == 'k')
        ++sum;
      else if (a[j] == 'h') {
        sum = 0;
        x[i] = (x[i] * 233 + a[j]) % 19260817;
      } else {
        for (int k = 1; k <= sum; k++) x[i] = (x[i] * 233 + 'k') % 19260817;
        if (a[j] == 'u') {
          x[i] = (x[i] * 233 + 'o') % 19260817;
          x[i] = (x[i] * 233 + 'o') % 19260817;
        } else
          x[i] = (x[i] * 233 + a[j]) % 19260817;
        sum = 0;
      }
    for (int k = 1; k <= sum; k++) x[i] = (x[i] * 233 + 'k') % 19260817;
  }
  sort(x + 1, x + n + 1);
  printf("%d\n", unique(x + 1, x + n + 1) - x - 1);
  return 0;
}
