#include <bits/stdc++.h>
using namespace std;
set<string> st;
void conv(char s[]) {
  char temp[500];
  int i, j;
  int fl = 1;
  for (i = 0, j = 0; s[i + 1] != '\0'; i++, j++) {
    if (s[i] == 'u') {
      temp[j] = 'o';
      temp[++j] = 'o';
      fl = 0;
    } else if (s[i] == 'k' && s[i + 1] == 'h') {
      temp[j] = 'h';
      i++;
      fl = 0;
    } else {
      temp[j] = s[i];
    }
  }
  if (s[i] != 'u')
    temp[j] = s[i];
  else {
    temp[j] = 'o';
    temp[++j] = 'o';
  }
  temp[j + 1] = '\0';
  if (!fl)
    conv(temp);
  else {
    string k;
    k.resize(500);
    for (i = 0; i <= j + 1; i++) {
      k[i] = temp[i];
    }
    st.insert(k);
  }
}
int main() {
  int n;
  cin >> n;
  int i = n;
  while (i--) {
    char s[500];
    cin >> s;
    conv(s);
  }
  cout << st.size();
  return 0;
}
