#include <bits/stdc++.h>
using namespace std;
const int N = 4e2 + 10;
int n;
string s[N];
string removeKH(string a) {
  string res = "", temp = "";
  bool found_k = false;
  for (int i = 0; i < (int)a.size(); ++i) {
    if (a[i] == 'k') {
      found_k = true;
      temp.push_back(a[i]);
    } else {
      if (found_k) {
        if (a[i] == 'h') {
          res.push_back('h');
        } else {
          res += temp;
          res.push_back(a[i]);
        }
        found_k = false;
        temp = "";
        continue;
      }
      res.push_back(a[i]);
    }
  }
  if (found_k) res += temp;
  return res;
}
string removeOO(string a) {
  string res = "", temp = "";
  bool found_u = false;
  for (int i = 0; i < (int)a.size(); ++i) {
    if (a[i] == 'u' || a[i] == 'o') {
      found_u = true;
      if (a[i] == 'u')
        temp += "oo";
      else
        temp.push_back('o');
    } else {
      if (found_u) {
        res += temp;
        found_u = false;
        temp = "";
      }
      res.push_back(a[i]);
    }
  }
  if (found_u) res += temp;
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) cin >> s[i];
  map<string, int> mp;
  for (int i = 0; i < n; ++i) {
    string temp = removeOO(s[i]);
    string temp2 = removeKH(temp);
    mp[temp2]++;
  }
  printf("%d\n", (int)mp.size());
  return 0;
}
