#include <bits/stdc++.h>
using namespace std;
template <class T>
inline void smax(T &x, T y) {
  x = max((x), (y));
}
template <class T>
inline void smin(T &x, T y) {
  x = min((x), (y));
}
map<string, int> M;
string s1, s2;
int main() {
  int i, j, k, l, m, n;
  cin >> n;
  int ans = 0;
  for (k = 1; k <= n; k++) {
    cin >> s1;
    s2.clear();
    char s[100];
    j = 0;
    for (i = 0; i < s1.size(); i++) {
      if (s1[i] == 'u') {
        s[j++] = 'o';
        s[j++] = 'o';
      } else
        s[j++] = s1[i];
    }
    s[j] = '\0';
    s2 = s;
    s1 = s2;
    char ch = 'z';
    s2.clear();
    j = 0;
    for (i = s1.size() - 1; i >= 0; i--) {
      if (s1[i] == 'k' && ch == 'h')
        continue;
      else {
        ch = s1[i];
        s[j++] = ch;
      }
    }
    s[j] = '\0';
    s2 = s;
    if (M.find(s2) == M.end()) {
      ans++;
      M[s2] = 1;
    }
  }
  printf("%d\n", ans);
  return 0;
}
