#include <bits/stdc++.h>
using namespace std;
const int MAXN = 450;
vector<int> adj[MAXN];
string data[MAXN];
int vis[MAXN];
void dfs(int u) {
  vis[u] = 1;
  for (int v : adj[u]) {
    if (!vis[v]) dfs(v);
  }
}
string process(string s) {
  string tmp = "";
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'u')
      tmp += "oo";
    else if (s[i] == 'h')
      tmp += "kh";
    else
      tmp += s[i];
  }
  s = tmp;
  tmp = "";
  int cnt = 0;
  for (int i = 0; i < s.size(); i++) {
    if (s[i] == 'k') {
      cnt++;
    } else {
      if (cnt) {
        if (s[i] == 'h')
          tmp += 'k';
        else {
          for (int j = 0; j < cnt; j++) tmp += 'k';
        }
      }
      cnt = 0;
      tmp += s[i];
    }
  }
  for (int i = 0; i < cnt; i++) tmp += 'k';
  return tmp;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  ;
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    string s;
    cin >> s;
    data[i] = process(s);
  }
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      if (data[i] == data[j]) {
        adj[i].push_back(j);
        adj[j].push_back(i);
      }
    }
  }
  int res = 0;
  for (int i = 0; i < n; i++) vis[i] = 0;
  for (int i = 0; i < n; i++) {
    if (!vis[i]) {
      res++;
      dfs(i);
    }
  }
  cout << res << endl;
  return 0;
}
