#include <bits/stdc++.h>
using namespace std;
int n;
const int maxn = 405;
char str[maxn][100];
set<string> st;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%s", str[i] + 1);
  }
  for (int i = 1; i <= n; i++) {
    int len = int(strlen(str[i] + 1));
    string aft;
    for (int j = 1; j <= len; j++) {
      if (str[i][j] == 'u')
        aft.push_back('o'), aft.push_back('o');
      else if (str[i][j] == 'h') {
        while (!aft.empty() && aft[aft.size() - 1] == 'k') aft.pop_back();
        aft.push_back('h');
      } else
        aft.push_back(str[i][j]);
    }
    st.insert(aft);
  }
  printf("%d\n", int(st.size()));
  return 0;
}
