#include <bits/stdc++.h>
using namespace std;
int main() {
  int m;
  cin >> m;
  set<string> ff;
  for (int l = 0; l < m; ++l) {
    string s;
    cin >> s;
    string fuck;
    int n = s.size();
    for (int i = 0; i < n;) {
      if (s[i] == 'k') {
        for (int j = i + 1; j < n; ++j) {
          if (s[j] == 'k')
            continue;
          else if (s[j] == 'h') {
            i = j;
            break;
          } else {
            break;
          }
        }
        fuck += s[i];
        ++i;
      } else if (s[i] == 'u') {
        ++i;
        fuck += "oo";
      } else {
        fuck += s[i];
        ++i;
      }
    }
    ff.insert(fuck);
  }
  cout << ff.size() << endl;
}
