#include <bits/stdc++.h>
#pragma comment(linker, "/stack:227420978")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
using namespace std;
const long long mod = 1000000007;
string fun(string temp) {
  string str2 = "";
  for (long long i = 0; i < temp.length(); i++) {
    if (temp[i] == 'u')
      str2 += "oo";
    else if (temp[i] == 'h')
      str2 += "kh";
    else
      str2 += temp[i];
  }
  temp = "";
  for (long long i = 0; i < str2.length();) {
    if (str2[i] == 'o') {
      if ((i + 1) != str2.length()) {
        if (str2[i + 1] == 'o') {
          temp += 'u';
          i++;
          i++;
        } else {
          temp += 'o';
          i++;
        }
      } else {
        temp += 'o';
        i++;
      }
    } else if (str2[i] == 'k') {
      long long count = 0, j;
      for (j = i; j < str2.length(); j++)
        if (str2[j] == 'k')
          count++;
        else
          break;
      if (j != str2.length()) {
        if (str2[j] == 'h') {
          temp += 'h';
          i = j + 1;
        } else {
          for (long long k = 0; k < count; k++) temp += 'k';
          i = j;
        }
      } else {
        for (long long k = 0; k < count; k++) temp += 'k';
        i = j;
      }
    } else {
      temp += str2[i];
      i++;
    }
  }
  return temp;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  long long n;
  cin >> n;
  set<string> names;
  while (n--) {
    string str;
    cin >> str;
    names.insert(fun(str));
  }
  cout << names.size();
  return 0;
}
