#include <bits/stdc++.h>
using namespace std;
string pal[405];
set<string> lista;
void minimizar(string &s) {
  string aux = "";
  for (int i = 0; i < (int)s.length(); i++) {
    if (s[i] == 'u') {
      aux.push_back('o');
      aux.push_back('o');
    } else
      aux.push_back(s[i]);
  }
  string sol = "";
  for (int i = (int)aux.length() - 1; i >= 0; i--) {
    if (i > 0 and aux[i] == 'o' and aux[i - 1] == 'o') {
      sol.push_back('u');
      i--;
    } else if (i > 0 and aux[i] == 'h' and aux[i - 1] == 'k') {
      while (i > 0 and aux[i - 1] == 'k') i--;
      sol.push_back('h');
    } else {
      sol.push_back(aux[i]);
    }
  }
  reverse(sol.begin(), sol.end());
  cerr << s << ": " << sol << endl;
  lista.insert(sol);
}
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> pal[i];
    minimizar(pal[i]);
  }
  cout << lista.size() << endl;
}
