// "let's be the last among the fastest" // #include using namespace std; typedef long long int ll; ll h[200]; int main() { ios_base::sync_with_stdio(0); ll n,m,k; for(char i='a';i<='z';i++) { cin>>k; h[i]=k; } string s; cin>>s; m=0; for(ll i=0;i