#include <bits/stdc++.h>
#pragma optimize("Ofast")
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  unordered_map<string, int> um;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    string t = "";
    int n = s.length();
    int cnt_k = 0;
    for (int i = 0; i < n; i++) {
      if (s[i] == 'k') {
        int j = i;
        while (j < n && s[j] == 'k') {
          j++;
        }
        if (j < n && s[j] == 'h') {
          t += 'h';
          i = j;
        } else {
          t += 'k';
        }
      } else if (s[i] == 'o' || s[i] == 'u') {
        int cnt_o = 0, j = i;
        while (j < n && (s[j] == 'o' || s[j] == 'u')) {
          if (s[j] == 'o') {
            cnt_o++;
          } else if (s[j] == 'u') {
            t += 'u';
          }
          j++;
        }
        int x = cnt_o / 2;
        for (int k = 1; k <= x; k++) {
          t += 'u';
        }
        if (cnt_o & 1) {
          t += 'o';
        }
        i = j - 1;
      } else {
        t += s[i];
      }
    }
    um[t]++;
  }
  cout << um.size();
  return 0;
}
