#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline void Int(T &n) {
  n = 0;
  int f = 1;
  register int ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    if (ch == '-') f = -1;
  for (; isdigit(ch); ch = getchar()) n = (n << 3) + (n << 1) + ch - '0';
  n = n * f;
}
template <typename T>
T gcd(T a, T b) {
  return !b ? a : gcd(b, a % b);
}
template <typename T>
inline void umin(T &a, T b) {
  a = a < b ? a : b;
}
template <typename T>
inline void umax(T &a, T b) {
  a = a > b ? a : b;
}
template <typename T, typename W>
inline void Int(T &x, W &y) {
  Int(x), Int(y);
}
template <typename T, typename W, typename Q>
inline void Int(T &x, W &y, Q &z) {
  Int(x, y), Int(z);
}
const int N = (int)1e5 + 5;
const int INF = (int)1e9 + 7;
const long long MOD = (long long)1e9 + 7;
int main() {
  int n;
  Int(n);
  set<string> res;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    while (1) {
      bool f = true;
      int sz = (int)s.size();
      for (int j = 0; j < sz - 1; j++) {
        if (s[j] == 'o' && s[j] == s[j + 1]) {
          f = false;
          s[j] = 'u';
          s[j + 1] = '*';
        }
        if (s[j] == 'k' && s[j + 1] == 'h') {
          s[j] = 'h';
          s[j + 1] = '*';
          f = false;
        }
        if (s[j] == 'o' && s[j + 1] == 'u') swap(s[j], s[j + 1]);
      }
      if (f) break;
    }
    string ans = "";
    for (int j = 0; s[j]; j++) {
      if (s[j] != '*') ans += s[j];
    }
    res.insert(ans);
  }
  cout << (int)res.size() << "\n";
  return 0;
}
