#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int N; cin >> N; string s; cin >> s; sort(s.rbegin(),s.rend()); cout << s << endl; vector C(26); for(auto c : s) C.at(c-'a')++; string yuki = "yuki"; yuki += 'a'-1; int answer = C.at(25); C.at(25) = 0; int low = 0,high = C.at(24)+1; while(high-low > 1){ int mid = (high+low)/2; auto D = C; int left = mid; D.at(24) -= mid; for(int c=1; c<5; c++){ int p1 = yuki.at(c-1)-'a',p2 = yuki.at(c)-'a'; for(int p=p2+1; p<=p1; p++){ left -= D.at(p); if(left <= 0){left = 0; break;} } if(c == 4 || left > D.at(p2) || left <= 0) break; D.at(p2) -= left; } if(left == 0) low = mid; else high = mid; } answer += low; cout << answer << endl; }