#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<double, double>;
using vi = vector<int>;
using vii = vector<pii>;
using vs = vector<string>;
const double PI = acos(-1.0);
const double EPS = 1e-14;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const ll INFLL = 4e18;
const int MAX = 400;
int n;
set<string> all;
string transform(string s) {
  while (s.find("u") != string::npos) {
    int idx = s.find("u");
    s.replace(idx, 1, "o");
    s = s.substr(0, idx) + "o" + s.substr(idx, (int)s.size());
  }
  while (s.find("kh") != string::npos) {
    s.erase(s.begin() + s.find("kh"));
  }
  while ((int)s.size() <= 80 && s.find("h") != string::npos) {
    int idx = s.find("h");
    s = s.substr(0, idx) + "k" + s.substr(idx, (int)s.size());
  }
  return s;
}
void read() {
  cin >> n;
  for (int i = 0; i < (int)n; i++) {
    string s;
    cin >> s;
    s = transform(s);
    all.insert(s);
  }
}
void solve() { cout << (int)all.size() << "\n"; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int TC = 1;
  while (TC--) {
    read();
    solve();
  }
}
