#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline T sqr(T t) {
  return t * t;
}
map<string, int> mp1;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 1; i <= n; i++) {
    string s;
    cin >> s;
    bool bb = 1;
    while (bb) {
      bb = 0;
      string nw;
      for (int j = s.size() - 1; j >= 0; j--) {
        if (j == 0) {
          nw += s[j];
          continue;
        }
        if (s[j] == 'o' && s[j - 1] == 'u') {
          nw += 'u';
          nw += 'o';
          bb = 1;
          j--;
        } else if (s[j - 1] == 'o' && s[j] == 'o') {
          nw += 'u';
          bb = 1;
          j--;
        } else if (s[j - 1] == 'k' && s[j] == 'h') {
          nw += 'h';
          bb = 1;
          j--;
        } else
          nw += s[j];
      }
      reverse(nw.begin(), nw.end());
      s = nw;
    }
    mp1[s] = 1;
  }
  cout << mp1.size();
}
