#include #include using namespace std; int main(){ int G,C,P; string S; int Ge=0,Ce=0,Pe=0; int ans=0; cin>>G>>C>>P; cin>>S; for(int i=0;iCe){ G-=Ce; ans+=Ce*3; Ce=0; } else{ Ce-=G; ans+=G*3; G=0; } if(C>Pe){ C-=Pe; ans+=Pe*3; Pe=0; } else{ Pe-=C; ans+=C*3; C=0; } if(P>Ge){ P-=Ge; ans+=Ge*3; Ge=0; } else{ Ge-=P; ans+=P*3; P=0; } if(G>Ge){ G-=Ge; ans+=Ge; Ge=0; } else{ Ge-=G; ans+=G; G=0; } if(C>Ce){ C-=Ce; ans+=Ce; Ce=0; } else{ Ce-=C; ans+=C; C=0; } if(P>Pe){ P-=Pe; ans+=Pe; Pe=0; } else{ Pe-=P; ans+=P; P=0; } cout<