#include <bits/stdc++.h>
using namespace std;
string solve(string s) {
  string ans = "";
  int n = s.size();
  for (int i = 0; i < n; ++i) {
    if (s[i] == 'u') {
      ans.push_back('o');
      ans.push_back('o');
    } else
      ans.push_back(s[i]);
  }
  string ans2 = "";
  bool flag = false;
  for (int i = ans.size() - 1; i >= 0; --i) {
    if (ans[i] == 'k' && flag)
      continue;
    else
      ans2.push_back(ans[i]);
    if (ans[i] == 'h')
      flag = true;
    else
      flag = false;
  }
  reverse(ans2.begin(), ans2.end());
  return ans2;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  map<string, int> M;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s;
    cin >> s;
    M[solve(s)]++;
  }
  cout << M.size() << "\n";
  return 0;
}
