#include <bits/stdc++.h>
using namespace std;
string a[410];
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  for (int i = 0; i < n; i++) {
    for (int j = a[i].size() + 1; j--;) {
      for (int l = 0; l < a[i].size(); l++) {
        if (a[i][l] == 'u') a[i].replace(l, 1, "oo");
      }
      for (int l = 0; l < a[i].size() - 1; l++) {
        if (a[i][l] == 'k' && a[i][l + 1] == 'h') a[i].replace(l, 2, "h");
      }
    }
  }
  sort(a, a + n);
  cout << unique(a, a + n) - a;
}
