#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[100000];
  cin.get();
  int i = 0;
  while (n--) {
    getline(cin, s[i]);
    stack<char> sk;
    for (int j = 0; j < s[i].size(); j++) {
      if (!sk.empty() && s[i][j] == 'h' && sk.top() == 'k') {
        while (sk.top() == 'k' && sk.size() > 1) sk.pop();
        if (sk.top() == 'k') {
          sk.pop();
        }
        sk.push('h');
      } else if (s[i][j] == 'u') {
        sk.push('o');
        sk.push('o');
      } else {
        sk.push(s[i][j]);
      }
    }
    s[i].resize(sk.size());
    for (int j = sk.size() - 1; j >= 0; j--) {
      s[i][j] = sk.top();
      sk.pop();
    }
    i++;
  }
  sort(s, s + i);
  int count = 1;
  string recent = s[0];
  for (int j = 1; j < (i); j++) {
    if (recent != s[j]) {
      recent = s[j];
      count++;
    }
  }
  cout << count;
  return 0;
}
