#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n;
  cin >> n;
  vector<string> vec(n);
  for (long long i = 0; i < n; i++) {
    cin >> vec[i];
  }
  set<string> sec;
  for (long long i = 0; i < n; i++) {
    bool change = true;
    while (change) {
      change = false;
      for (long long j = 0; j < vec[i].size() - 1; j++) {
        if (vec[i][j] == 'o' && vec[i][j + 1] == 'o') {
          vec[i].erase(vec[i].begin() + j + 1);
          vec[i][j] = 'u';
          j--;
          change = true;
          continue;
        }
        if (vec[i][j] == 'k' && vec[i][j + 1] == 'h') {
          vec[i].erase(vec[i].begin() + j + 1);
          vec[i][j] = 'h';
          j--;
          change = true;
          continue;
        }
        if (vec[i][j] == 'o' && vec[i][j + 1] == 'u') {
          vec[i][j] = 'u';
          vec[i][j + 1] = 'o';
          change = true;
          continue;
        }
      }
    }
    sec.insert(vec[i]);
  }
  cout << sec.size() << endl;
  return 0;
}
