#include <bits/stdc++.h>
using namespace std;
const int oo = 0x3f3f3f3f;
const long long ooo = 9223372036854775807ll;
const int _cnt = 1000 * 1000 + 7;
const int _p = 1000 * 1000 * 1000 + 7;
const int N = 100005;
const double PI = acos(-1.0);
const double eps = 1e-9;
int o(int x) { return x % _p; }
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
int lcm(int a, int b) { return a / gcd(a, b) * b; }
void file_put() {
  freopen("filename.in", "r", stdin);
  freopen("filename.out", "w", stdout);
}
char S[100];
char str[100];
int top;
int main() {
  int n;
  while (~scanf("%d", &n)) {
    set<string> myset;
    for (int i = 1; i <= n; i++) {
      top = 0;
      scanf("%s", str);
      int len = strlen(str);
      string tmp;
      for (int i = (0); i <= (len); ++i) {
        if (str[i] == 'u') {
          S[top++] = 'o';
          S[top++] = 'o';
          continue;
        } else if (!top) {
          S[top++] = str[i];
          continue;
        } else if (str[i] == 'h') {
          while (top && S[top - 1] == 'k') top--;
          S[top++] = 'h';
          continue;
        }
        S[top++] = str[i];
      }
      for (int i = 0; i < top; i++) tmp += S[i];
      myset.insert(tmp);
    }
    printf("%d\n", (int)myset.size());
  }
  return 0;
}
