#include using namespace std; int backet[26]; int main(){ int n; cin>>n; string s; cin>>s; for(int i=0;iyuki[i];j--){ ans+=min(backet[j],use); use-=min(backet[j],use); if(use<=0) goto end; } if(yuki[i]-use<0){ int cnt=use-yuki[i]; ans+=cnt/2; use-=(cnt/2)*2; if(cnt%2&&use) ans++,use--; } else if(yuki[i]-use>0){ int cnt=yuki[i]-use; ans+=min(use,cnt); use-=min(use,cnt); } } for(int i=7;i>=0;i--){ ans+=min(use,backet[i]); use-=min(use,backet[i]); } end:; cout<