#include #include #include using namespace std; int main(int argc, const char * argv[]) { int h[26], max = 0; string S; for(int i = 0; i < 26; i++) cin>>h[i]; cin>>S; for(int i = 0; i < S.size(); i++) { if(h[S[i] - 'a'] > max) max = h[S[i] - 'a']; } cout<