#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n;
  cin >> n;
  set<string> st;
  while (n--) {
    string s;
    cin >> s;
    string s1;
    for (char a : s) {
      if (a == 'u')
        s1.push_back('o'), s1.push_back('o');
      else
        s1.push_back(a);
    }
    string s2;
    for (char a : s1) {
      if (a == 'h') {
        while (!s2.empty() && s2.back() == 'k') s2.pop_back();
      }
      s2.push_back(a);
    }
    st.insert(s2);
  }
  cout << st.size() << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.precision(17);
  solve();
  return 0;
}
