#include <bits/stdc++.h>
using namespace std;
vector<string> res;
set<string> ss;
int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string d;
    cin >> d;
    int z = d.size();
    string s1 = "";
    for (int j = 0; j < z; j++) {
      if (d[j] == 'u') {
        s1.push_back('o');
        s1.push_back('o');
        continue;
      }
      s1.push_back(d[j]);
    }
    d = s1;
    z = d.size();
    int kk = 1;
    string s = "";
    for (int j = 0; j < z; j++) {
      if (d[j] != 'k') {
        s.push_back(d[j]);
        continue;
      }
      int k = 0;
      string o = "";
      while (j < z && d[j] == 'k') {
        o.push_back(d[j]);
        j++;
        k++;
      }
      if (d[j] != 'h') {
        j--;
        for (int l = 0; l < k; l++) {
          s.push_back(o[l]);
        }
        continue;
      } else if (d[j] == 'h') {
        j--;
        continue;
      }
    }
    res.push_back(s);
  }
  for (int i = 0; i < n; i++) {
    ss.insert(res[i]);
  }
  cout << ss.size() << endl;
}
