#include <bits/stdc++.h>
using namespace std;
set<string> s;
int main() {
  int n, len;
  cin >> n;
  string name, str, temp;
  cin.clear();
  cin.ignore();
  for (int i = 0; i < n; i++) {
    cin >> name;
    str = "";
    len = name.length();
    int j, k;
    j = k = 0;
    for (int j = 0; j < len; j++) {
      if (name[j] == 'k') {
        temp = "";
        while (j < len && name[j] == 'k') {
          temp += name[j];
          j += 1;
        }
        if (j < len && name[j] == 'h') {
          str += "h";
        } else {
          if (j < len && name[j] != 'u')
            temp += name[j];
          else if (j < len && name[j] == 'u')
            temp += "oo";
          str += temp;
        }
      } else if (name[j] == 'u')
        str += "oo";
      else {
        str += name[j];
      }
    }
    s.insert(str);
  }
  cout << s.size();
  return 0;
}
