import java.beans.IntrospectionException; import java.util.*; class Main { static int jan(int g,int c,int p){ if(g==0 && c ==0 && p==0)return 0; if(dp[g][c][p]>0)return dp[g][c][p]; int res = 0; if(g>0){ res = Math.max(res, jan(g-1, c, p)+ja[gu][Integer.parseInt(te.charAt(te.length()-g-c-p)+"")]); } if(c>0){ res = Math.max(res, jan(g, c-1, p)+ja[tyo][Integer.parseInt(te.charAt(te.length()-g-c-p)+"")]); } if(p>0){ res = Math.max(res, jan(g, c, p-1)+ja[pa][Integer.parseInt(te.charAt(te.length()-g-c-p)+"")]); } return dp[g][c][p]=res; } static int[][][] dp; static int gu = 0; static int tyo = 1; static int pa = 2; static int[][] ja = new int[3][3]; static String te; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int g = sc.nextInt(); int c = sc.nextInt(); int p = sc.nextInt(); String temp = sc.next(); for(int i=0;i