#include using namespace std; int main() { /* Enter your code here. Read input from STDIN. Print output to STDOUT */ vector hei(26); for(int& h:hei) cin >> h; string str; cin>>str; int res=0; for(char c:str) res=max(res,hei[c-'a']); res*=str.size(); cout<