#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  string s[400];
  for (int i(0); i < n; ++i) {
    cin >> s[i];
    for (int j(0); j < s[i].length(); ++j) {
      if (s[i][j] == 'u') {
        s[i].replace(j, 1, "oo");
        j = 0;
      }
      if (s[i][j] == 'h') {
        int numb = 0;
        if (j && s[i][j - 1] == 'k') {
          for (int k(j - 1); k >= 0; --k) {
            if (s[i][k] == 'k')
              numb++;
            else
              break;
          }
          s[i].replace(j - numb, numb + 1, "h");
          j = 0;
        }
      }
    }
  }
  map<string, int> Map;
  for (int i(0); i < n; ++i) {
    Map[s[i]];
  }
  cout << Map.size() << endl;
  return 0;
}
