#include <bits/stdc++.h>
using namespace std;
const int INF = 1 << 30;
const int maxn = 2333333;
const int mod = 1000000007;
string str, s[maxn];
int n, ans = 0;
int main() {
  cin >> n;
  for (int t = 0; t < n; t++) {
    cin >> str;
    for (int i = 0; i < str.size(); i++) {
      if (str[i] == 'u')
        s[t] = s[t] + "oo";
      else if (str[i] == 'k') {
        int j = i;
        while (j < str.size() && str[j] == 'k') j++;
        if (str[j] != 'h') {
          s[t] = s[t] + str.substr(i, j - i);
          i = j - 1;
        }
      } else
        s[t] = s[t] + str[i];
    }
  }
  map<string, int> mp;
  int cnt = 0;
  for (int i = 0; i < n; i++) {
    if (!mp.count(s[i])) {
      mp[s[i]] = cnt++;
    }
  }
  cout << cnt << endl;
  return 0;
}
