#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
const long long mod = pow(10, 9) + 7;
const long long N = 3e5, M = N;
const long long inf = LLONG_MAX;
const long long infn = LLONG_MIN;
string convert(string s) {
  long long n = s.length(), i;
  while (true) {
    bool done = 0;
    for (auto it = s.begin(); it != s.end(); it++) {
      auto p = it;
      p++;
      if (p == s.end())
        break;
      else if (*it == 'k' && *p == 'h') {
        s.erase(it);
        it--;
        done = 1;
      }
    }
    if (!done) break;
  }
  string k = "";
  for (long long i = 0; i < s.length(); i++) {
    if (s[i] == 'u') {
      k += "oo";
    } else
      k += s[i];
  }
  {
    string _s = "k";
    replace(_s.begin(), _s.end(), ',', ' ');
    stringstream _ss(_s);
    istream_iterator<string> _it(_ss);
    err(_it, k);
  };
  return k;
}
void iluzn() {
  long long n;
  cin >> n;
  long long k = n;
  set<string> st;
  while (n--) {
    string s;
    cin >> s;
    s = convert(s);
    st.insert(s);
  }
  cout << st.size() << "\n";
}
signed main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long t = 1;
  while (t--) iluzn();
  return 0;
}
