#include using namespace std; int A[100]; int main(){ for(int i=1; i<=26; ++i) cin >> A[i]; string s; cin >> s; int maxi = 0; for(int i=0; i