/* ID: ganeshk2 lang: cpp */ #include using namespace std; typedef long long ll; typedef pair ii; typedef pair pll; typedef vector vi; typedef vector vl; typedef vector vii; typedef vector vpll; typedef vector vvi; typedef vector vvl; #define si(x) scanf("%d",&x) #define sl(x) scanf("%I64d",&x) #define ss(s) scanf("%s",s) #define pb push_back #define mp make_pair #define rep(i,b,a) for(i=a;i>=1){if(b&(1LL))res=(res*a)%MOD;a=a*a%MOD;}return res;} int scan_d(){ int ip=getchar_unlocked(),ret=0,flag=1;for(;ip<'0'||ip>'9';ip=getchar_unlocked()) if(ip=='-'){flag=-1;ip=getchar_unlocked();break;} for(;ip>='0'&&ip<='9';ip=getchar_unlocked())ret=ret*10+ip-'0';return flag*ret;} ll scan_lld(){ int ip=getchar_unlocked(),flag=1;ll ret=0;for(;ip<'0'||ip>'9';ip=getchar_unlocked()) if(ip=='-'){flag=-1;ip=getchar_unlocked();break;} for(;ip>='0'&&ip<='9';ip=getchar_unlocked())ret=ret*10+ip-'0';return flag*ret;} */ #define maxn 100010 int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); int a[26],i,maxx=0; f(i,26) cin>>a[i]; string s; cin>>s; f(i,s.size()) maxx=max(maxx,a[s[i]-'a']); cout<