#include <bits/stdc++.h>
using namespace std;
string a[1009];
int n;
set<string> s;
string h;
int main() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    for (int j = 0; j < a[i].size(); j++) {
      char l = a[i][j];
      if (a[i][j] == 'u') {
        h += "oo";
      } else if (a[i][j] == 'k') {
        for (int k = j; k < a[i].size(); k++) {
          if (a[i][k] == 'h') {
            h += 'h';
            j = k;
            goto ss;
          }
          if (a[i][k] != 'k') {
            h += a[i][j];
            goto ss;
          }
        }
        h += a[i][j];
      ss:;
      } else
        h += a[i][j];
    }
    s.insert(h);
    h.clear();
  }
  cout << s.size();
}
