#include #include #include #include #include #include using namespace std; int main() { int n; string s; vector chars(255, 0); cin >> n >> s; for (int i = 0; i < n; i++) { chars[s[i]]++; } int ans = 0; ans += chars['z']; chars['z'] = 0; int val; // yu for (char c = 'z'; c > 'u'; c--) { if (c == 'y') { continue; } val = min(chars['y'], chars[c]); ans += val; chars['y'] -= val; chars[c] -= val; } // yuk for (char c = 'z'; c > 'k'; c--) { if (c == 'y' || c == 'u') { continue; } val = min({chars['y'], chars['u'], chars[c]}); ans += val; chars['y'] -= val; chars['u'] -= val; chars[c] -= val; } // yuki for (char c = 'z'; c > 'i'; c--) { if (c == 'y' || c == 'u' || c =='k') { continue; } val = min({chars['y'], chars['u'], chars['k'], chars[c]}); ans += val; chars['y'] -= val; chars['u'] -= val; chars['k'] -= val; chars[c] -= val; } // yukk val = min({chars['y'], chars['u'], chars['k'] / 2}); ans += val; chars['y'] -= val; chars['u'] -= val; chars['k'] -= val * 2; // yuu val = min(chars['y'], chars['u'] / 2); ans += val; chars['y'] -= val; chars['u'] -= val * 2; // yy val = chars['y'] / 2; ans += val; chars['y'] -= val * 2; cout << ans << endl; return 0; }