#include <bits/stdc++.h>
using namespace std;
map<string, int> mp;
int main() {
  int i, j, n, m, t;
  string s;
  cin >> t;
  int cnt = 0;
  for (i = 0; i < t; i++) {
    cin >> s;
    int len = s.size();
    string ans;
    int chk = 1;
    while (chk == 1) {
      ans.clear();
      chk = 0;
      len = s.size();
      for (j = 0; j < len - 1; j++) {
        if (s[j] == 'o' && s[j + 1] == 'o') {
          ans.push_back('u');
          j++;
          chk = 1;
        } else if (s[j] == 'k' && s[j + 1] == 'h') {
          ans.push_back('h');
          j++;
          chk = 1;
        } else if (s[j] == 'u' && s[j + 1] == 'o') {
          s[j] = 'o';
          s[j + 1] = 'u';
          chk = 1;
          ans.push_back('o');
        } else
          ans.push_back(s[j]);
      }
      if (j == len - 1) ans.push_back(s[j]);
      s = ans;
    }
    if (mp[ans] == 0) {
      cnt++;
    }
    mp[ans]++;
  }
  cout << cnt << endl;
}
