#include <bits/stdc++.h>
using namespace std;
const int maxl = 50 + 5;
set<string> st;
int main() {
  ios_base::sync_with_stdio(false);
  int n, len, k, flag;
  string s1, s2, s3;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s1;
    s2.clear();
    len = s1.size();
    k = 0;
    flag = 0;
    for (int j = len - 1; j >= 0; j--) {
      if (s1[j] == 'h') {
        flag = 1;
      } else if (s1[j] == 'k' && flag) {
        flag = 1;
        continue;
      } else {
        flag = 0;
      }
      if (s1[j] == 'u') {
        s2 += 'o';
        s2 += 'o';
      } else {
        s2 += s1[j];
      }
    }
    reverse(s2.begin(), s2.end());
    st.insert(s2);
  }
  printf("%d\n", st.size());
  return 0;
}
