#include "bits/stdc++.h" using namespace std; int main() { vector count(26); int N; cin >> N; string S; cin >> S; for (int i = 0; i < N; i++) { count[S[i] - 'a']++; } int ans = 0; for (int i = 0; i < 26; i++) { while (count['y' - 'a'] > 0 && count['u' - 'a'] > 0 && count['k' - 'a'] > 0 && count['i' - 'a'] > 0 && count[i] > 0){ count['y' - 'a']--; count['u' - 'a']--; count['k' - 'a']--; count['i' - 'a']--; count[i]--; ans++; } } for (int i = 'i' - 'a' + 1; i < 26; i++) { while (count['y' - 'a'] > 0 && count['u' - 'a'] > 0 && count['k' - 'a'] > 0 && count[i] > 0){ count['y' - 'a']--; count['u' - 'a']--; count['k' - 'a']--; count[i]--; ans++; } } for (int i = 'k' - 'a' + 1; i < 26; i++) { while (count['y' - 'a'] > 0 && count['u' - 'a'] > 0 && count[i] > 0){ count['y' - 'a']--; count['u' - 'a']--; count[i]--; ans++; } } for (int i = 'u' - 'a' + 1; i < 26; i++) { while (count['y' - 'a'] > 0 && count[i] > 0){ count['y' - 'a']--; count[i]--; ans++; } } for (int i = 'y' - 'a' + 1; i < 26; i++) { while (count[i] > 0){ count[i]--; ans++; } } cout << ans << endl; }