#include #include using namespace std; int main(){ int g,c,p; cin>>g>>c>>p; string s; cin>>s; int og=0,oc=0,op=0; for(int i=0;i<(int)s.size();i++){ if(s[i]=='G') og++; else if(s[i]=='C') oc++; else op++; } int point=0; if(og<=p){ point+=3*og; p-=og; og=0; } else{ point+=3*p; og-=p; p=0; } if(oc<=g){ point+=3*oc; g-=oc; oc=0; } else{ point+=3*g; oc-=g; g=0; } if(op<=c){ point+=3*op; c-=op; op=0; } else{ point+=3*c; op-=c; c=0; } point+=min(og,g)+min(oc,c)+min(op,p); cout<