#include #include #include #include #include #include #include int main(){ int i,max_h=0,l,n=26; int *h = malloc(sizeof(int) * n); for(int h_i = 0; h_i < n; h_i++){ scanf("%d",&h[h_i]); } char* word = (char *)malloc(512000 * sizeof(char)); scanf("%s",word); l=strlen(word); for(i=0;imax_h) max_h=h[word[i]-97]; } printf("%d",max_h*l); return 0; }