#include using namespace std; typedef long long ll; int main() { int a[3]; cin>>a[0]>>a[1]>>a[2]; string s;cin>>s; int b[3]{}; for (char c:s) { if (c=='G')b[0]++; else if (c=='C')b[1]++; else b[2]++; } int ans=0; for (int i=0;i<3;i++) { int mn=min(a[i],b[(i+1)%3]); a[i]-=mn; b[(i+1)%3]-=mn; ans+=3*mn; } for (int i=0;i<3;i++) { ans+=min(a[i],b[i]); } cout<