#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  set<string> s;
  for (int i = 0; i < n; i++) {
    string t;
    cin >> t;
    t += '.';
    string w = "";
    int c = 0, k = 0;
    for (char x : t) {
      if (c && (x != 'o' && x != 'u')) {
        stringstream nm;
        nm << c;
        w += nm.str();
        c = 0;
      }
      if (x == 'k') {
        k++;
        continue;
      }
      if (x == 'h') k = 0;
      while (k > 0) w += "k", k--;
      if (x == 'o' || x == 'u')
        c += (x == 'u' ? 2 : 1);
      else
        w += x;
    }
    s.insert(w);
  }
  cout << int(s.size()) << endl;
}
