#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(backet[yuki[i]]-use<0){ int cnt=use-backet[yuki[i]]; ans+=cnt/2; use-=(cnt/2)*2; if(cnt%2&&use) ans++,use--; } else if(backet[yuki[i]]-use>0){ int cnt=backet[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<