#include #include #include #include #define rep(i,a,b) for(int i=(a);i<(b);i++) #define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--) #define all(x) begin(x),end(x) #define sz(x) (int)(x).size() using namespace std; using namespace atcoder; using ll=long long; using ld=long double; using vll=vector; using vvll=vector; using vi=vector; using vvi=vector; using pll=pair; using pi=pair; using mint=modint998244353; // using mint=modint1000000007; // using mint2=static_modint<2>; // using BoostPoint=boost::polygon::point_data; // using Voronoi=boost::polygon::voronoi_diagram; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); int N; string S; cin>>N>>S; vi cnt(26); for(auto s:S)cnt[s-'a']++; auto ok=[N](int k,vi cnt){ string target="yuki"; int alive=k,alive2=N; for(auto c:target){ rrep(i,c-'a'+1,26){ int mn=min(alive,cnt[i]); alive2-=mn; alive-=mn; cnt[i]-=mn; } if(alive>cnt[c-'a'])return false; cnt[c-'a']-=alive; alive2-=alive; } if(alive>alive2)return false; else return true; }; int lo=0,hi=N+1; while(hi-lo>1){ int mid=(lo+hi)/2; if(ok(mid,cnt))lo=mid; else hi=mid; } cout<