#include <bits/stdc++.h>
using namespace std;
const int inf32 = 1e8 + 9;
const long long inf64 = 1e18 + 18;
const int N = 402;
set<string> st;
int main() {
  int n, j;
  string s, rez;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> s;
    rez.clear();
    for (j = 0; j < s.length(); ++j) {
      if (s[j] == 'k') {
        int k = j;
        while (k < s.length() && s[k] == 'k') ++k;
        if (s[k] == 'h') {
          rez.push_back('h');
          j = k;
        } else {
          for (j; j < k; ++j) rez.push_back('k');
          --j;
        }
      } else if (s[j] == 'u') {
        rez.push_back('o');
        rez.push_back('o');
      } else
        rez.push_back(s[j]);
    }
    st.insert(rez);
  }
  printf("%d", st.size());
  return 0;
}
