#include <bits/stdc++.h>
using namespace std;
char str[500][50];
set<string> key;
int main() {
  int n;
  while (scanf("%d", &n) != EOF) {
    for (int i = 0; i < n; i++) {
      scanf("%s", str[i]);
      int ss = 0;
      int len = strlen(str[i]);
      for (int j = 0; j < len; j++) {
        if (str[i][j] == 'o' || str[i][j] == 'u') {
          ss++;
        } else {
          sort(str[i] + j - ss, str[i] + j, greater<int>());
          ss = 0;
        }
      }
      sort(str[i] + len - ss, str[i] + len, greater<int>());
      for (int j = 0; j < len - 1;) {
        if (str[i][j] == 'o' && str[i][j + 1] == 'o') {
          str[i][j] = 'u';
          str[i][j + 1] = ' ';
          j += 2;
        } else {
          j++;
        }
      }
      for (int j = 0; j < len; j++) {
        if (str[i][j] == 'h') {
          int k = j - 1;
          while (k >= 0 && str[i][k] == 'k') {
            str[i][k--] = ' ';
          }
        }
      }
      istringstream st(str[i]);
      string name = "";
      string rec;
      while (st >> rec) {
        name = name + rec;
      }
      int lenx = name.length();
      int s = 0;
      for (int j = 0; j < lenx; j++) {
        if (name[j] == 'o' || name[j] == 'u') {
          s++;
        } else {
          sort(name.begin() + j - s, name.begin() + j, greater<int>());
          s = 0;
        }
      }
      sort(name.begin() + lenx - s, name.end(), greater<int>());
      key.insert(name);
    }
    printf("%d\n", key.size());
    key.clear();
  }
}
