#include using namespace std; /*{{{*/ //template #define REP(i,n) for(int i=0;i ostream& operator<<(ostream& os,const vector& vec){ os << "["; for(const auto& v : vec){ os << v << ","; } os << "]"; return os; } template ostream& operator<<(ostream& os,const pair& p){ os << "(" << p.first << ","<< p.second <<")"; return os; } typedef long long ll; typedef unsigned long long ull; typedef pair pii; typedef vector vi; typedef vector vvi; ll gcd(ll a,ll b){ if(b==0) return a; else return gcd(b,a%b); } constexpr ll mod = 1e9+7; const int dx[]={1,0,-1,0} ,dy[] = {0,1,0,-1}; /*}}}*/ int main(){ int N; cin>>N; string s; cin>>s; sort(all(s)); cerr << s << endl; int cntz = count_if(s.begin(),s.end(),[](char c){return c=='z';}); int cnty = count_if(s.begin(),s.end(),[](char c){return c=='y';}); int cntu = count_if(s.begin(),s.end(),[](char c){return c=='u';}); int cntk = count_if(s.begin(),s.end(),[](char c){return c=='k';}); int cnti = count_if(s.begin(),s.end(),[](char c){return c=='i';}); int ans=cntz; priority_queue que; for(int i=0;i'u'){ ans++; cnty--; }else if(p>'k'){ if(cntu==0) break; ans++; cnty--; cntu--; }else if(p>'i'){ if(cntu==0 or cntk==0) break; ans++; cnty--; cntu--; cntk--; }else{ break; } } if(cntu>0 and cntk>0 and cnti>=2){ int t=min({cnty,cntu,cntk,cnti/2}); ans+=t; cnty-=t; cntu-=t; cntk-=t; cnti-=t*2; } if(cntu>0 and cntk>=2){ int t=min(min(cnty,cntu),cntk/2); ans+=t; cnty-=t; cntu-=t; cntk-=t*2; } if(cntu>=2){ int t=min(cnty,cntu/2); ans+=t; cnty-=t; cntu-=t*2; } if(cnty>=2){ ans += cnty/2; } cout << ans << endl; }