#include <bits/stdc++.h>
using namespace std;
int inf = std::numeric_limits<int>().max();
inline long long soma(long long x, long long y) {
  return (x % 1000000007 + y % 1000000007) % 1000000007;
}
inline long long subtrai(long long x, long long y) {
  return ((x % 1000000007 - y % 1000000007) + 1000000007) % 1000000007;
}
inline long long multiplica(long long x, long long y) {
  return (x % 1000000007 * y % 1000000007) % 1000000007;
}
void write(long long x) { cout << x << endl; }
void writee(long long x) { cout << x << " "; }
void writes(string s) { cout << s << "\n"; }
string retira_k(string s) {
  string t = "";
  int j = s.size() - 1;
  while (j >= 0) {
    if (s[j] == 'h') {
      t += 'h';
      j--;
      while (j >= 0 and s[j] == 'k') j--;
      j++;
    } else
      t += s[j];
    j--;
  }
  reverse(t.rbegin(), t.rend());
  return t;
}
string retira_u(string s) {
  string t = "";
  for (int j = 0; j < s.size(); j++) {
    if (s[j] == 'u')
      t += "oo";
    else
      t += s[j];
  }
  return t;
}
int main() {
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  vector<string> v(n), w(n);
  string s;
  for (int i = 0; i < v.size(); i++) {
    cin >> v[i];
  }
  for (int i = 0; i < v.size(); i++) {
    s = retira_k(v[i]);
    s = retira_u(s);
    w[i] = s;
  }
  set<string> c;
  for (int i = 0; i < w.size(); i++) {
    if (!c.count(w[i])) c.insert(w[i]);
  }
  cout << c.size() << endl;
  return 0;
}
