#include using namespace std; int h[26]; int main() { for(int i=0; i<26; ++i) scanf("%d",&h[i]); string s; cin>>s; int mx=-1; for(int i=0; i