#include <bits/stdc++.h>
using namespace std;
const int MaxN = 5e5 + 17;
const int INF = 1e9 + 17;
const int MOD = 1e9 + 7;
const double eps = 1e-3;
const double pi = 3.14159265359;
int main() {
  int n;
  set<string> m;
  cin >> n;
  while (n--) {
    string second;
    cin >> second;
    string S;
    for (int i = 0; i < second.size(); ++i) {
      int k = i;
      if (second[i] == 'u') {
        S += 'o';
        S += 'o';
        continue;
      }
      int j = i;
      while (second[j] == 'k' && j < second.size()) ++j;
      if (second[j] == 'h' && j != i) {
        S += 'h';
        i = j;
      } else {
        S += second[i];
      }
    }
    m.insert(S);
  }
  cout << m.size() << "\n";
  return 0;
}
