#include <bits/stdc++.h>
using namespace std;
int main() {
  int sum, n;
  while (cin >> n) {
    sum = 1;
    string name[405];
    string str;
    for (int i = 0; i < n; i++) {
      cin >> str;
      int len = str.size();
      for (int j = len - 1; j >= 0; j--) {
        if (str[j] == 'o' && str[j - 1] == 'o') {
          str[j - 1] = 'u';
          continue;
        }
        if (str[j] == 'o' && str[j - 1] == 'u') {
          str[j] = 'u';
          str[j - 1] = 'o';
        }
        if (str[j] == 'h' && j > 0 && str[j - 1] == 'k') {
          str[j - 1] = 'h';
          continue;
        }
        name[i] += str[j];
      }
    }
    sort(name, name + n);
    for (int i = 0; i < n - 1; i++) {
      if (name[i] != name[i + 1]) sum++;
    }
    cout << sum << endl;
  }
  return 0;
}
