#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
const int MAXN = 400;
const int MAXLEN = 20;
int n;
char s[MAXN][MAXLEN + 1];
char t[2 * MAXLEN + 1];
int tlen;
set<string> all;
void run() {
  scanf("%d", &n);
  for (int i = (0); i < (n); ++i) scanf("%s", s[i]);
  all.clear();
  for (int i = (0); i < (n); ++i) {
    int slen = strlen(s[i]);
    tlen = 0;
    for (int j = (0); j < (slen); ++j) {
      char c = s[i][j];
      if (c == 'u') {
        t[tlen++] = 'o';
        t[tlen++] = 'o';
        continue;
      }
      if (c == 'h')
        while (tlen >= 1 && t[tlen - 1] == 'k') --tlen;
      t[tlen++] = c;
    }
    t[tlen] = '\0';
    all.insert(t);
  }
  printf("%d\n", ((int)(all).size()));
}
int main() {
  run();
  return 0;
}
