#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int n, k, c;
string x;
map<string, bool> name;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    k = 0;
    string y;
    cin >> x;
    for (int j = 0; j < x.length(); j++) {
      if (x[j] == 'k')
        k++;
      else if (x[j] == 'h')
        k = 0, y += 'h';
      else {
        while (k > 0) k--, y += 'k';
        if (x[j] == 'u')
          y += "oo";
        else
          y += x[j];
      }
    }
    while (k > 0) k--, y += 'k';
    if (name[y]) continue;
    name[y] = 1, c++;
  }
  cout << c;
  return 0;
}
