#include #include #include #include #include #include #define N_MAX 10000 #define USED 0 using namespace std; int main() { int N, ans = 0; char S[N_MAX]; cin >> N >> S; sort(S, S + N); bool find; //ごり押してみる ikuy for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u' && S[j] < 'y') for (int k = 0; k < N && find; ++k) if (S[k] == 'k' && S[k] < 'u') for (int l = 0; l < N && find; ++l) if (S[l] == 'i' && S[l] < 'k') for (int m = 0; m < N && find; ++m) { if (m == i || m == j || m == k || m == l) continue; else if (S[m] != USED && S[m] < 'i') { S[m] = S[l] = S[k] = S[j] = S[i] = USED; ++ans; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u' && S[j] < 'y') for (int k = 0; k < N && find; ++k) if (S[k] == 'k' && S[k] < 'u') for (int l = 0; l < N && find; ++l) { if (l == i || l == j || l == k) continue; else if (S[l] > 'i' && S[l] < 'k') { ++ans; S[l] = S[k] = S[j] = S[i] = USED; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u' && S[j] < 'y') for (int k = 0; k < N && find; ++k) { if (k == i || k == j) continue; else if (S[k] > 'k' && S[k] < 'u') { ++ans; S[k] = S[j] = S[i] = USED; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) { if (j == i) continue; else if (S[j] > 'u' && S[j] < 'y') { ++ans; S[j] = S[i] = USED; find = false; } } } for (int i = 0; i < N; ++i) if (S[i] > 'y') { ++ans; S[i] = USED; } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u') for (int k = 0; k < N && find; ++k) if (S[k] == 'k') for (int l = 0; l < N && find; ++l) if (S[l] == 'i') for (int m = 0; m < N && find; ++m) { if (m == i || m == j || m == k || m == l) continue; else if (S[m] != USED) { S[m] = S[l] = S[k] = S[j] = S[i] = USED; ++ans; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u') for (int k = 0; k < N && find; ++k) if (S[k] == 'k') for (int l = 0; l < N && find; ++l) { if (l == i || l == j || l == k) continue; else if (S[l] > 'i') { ++ans; S[l] = S[k] = S[j] = S[i] = USED; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) if (S[j] == 'u') for (int k = 0; k < N && find; ++k) { if (k == i || k == j) continue; else if (S[k] > 'k') { ++ans; S[k] = S[j] = S[i] = USED; find = false; } } } for (int i = 0; i < N; ++i, find = true) { if (S[i] == 'y') for (int j = 0; j < N && find; ++j) { if (j == i) continue; else if (S[j] > 'u') { ++ans; S[j] = S[i] = USED; find = false; } } } cout << ans; return 0; }