#include #include #include #include using namespace std; int main(){ vector letter; for(int i=0;i<26;i++) { int tmp; cin >> tmp; letter.push_back(tmp); } string word; cin >> word; int heighest = 0; for(int i=0;i heighest) heighest = letter[word[i] - 97]; } cout << heighest * word.length() << endl; }