#include "bits/stdc++.h" #define wsp cin >> ws; #define sp setprecision #define sz size() #define sn(n) scanf("%lld",&n) #define cn(n) cin>>n #define pr(n) printf("%lld\n",n) #define ff first #define ss second #define pry cout<<"Yes"<=0;i--) #define forn(i,a,b) for(ll i=a;i>=b;i--) #define all(n) n.begin(),n.end() #define alll(n,i,j) n.begin()+i,n.begin()+j #define present(s,x) (s.find(x) != s.end()) #define cpresent(s,x) (find(all(s),x) != s.end()) #define LALIT ios_base::sync_with_stdio(false);cin.tie(0) #define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++) #define mem(n,m) memset(n,m,sizeof(n)) #define mp make_pair #define mod 1000000007 #define E 1e-9 #define PI 3.14159265358979323846 #define N 300005 using namespace std; typedef unsigned long long int ull; typedef long long int ll; typedef pair i_i; typedef pair ll_i; typedef pair d_i; typedef pair ll_ll; typedef pair d_d; /* template void prin(vector >& a) { for(int i=0;i void prin(vector& a) { for(int i=0;i void prin_new_line(vector& a) { for(int i=0;i void prin_new_line(vector >& a) { for(int i=0;i& a) { int s=0; for(int i=0;i T max(vector& a) { T ans=a[0]; for(int i=1;i T min(vector& a) { T ans=a[0]; for(int i=1;i T min(T a,T b,T c) { return min(a,min(b,c)); } template T max(T a,T b,T c) { return max(a,max(b,c)); } long double s_triangle(long double x1,long double y1,long double x2,long double y2,long double x3,long double y3) { return abs(((x2-x1)*(y3-y1)-(x3-x1)*(y2-y1))/2); } bool overflow(ll a,ll b) { if(a*b/b!=a) return true; return false; } */ ll n = 26, k , l , t , j , cnt; ll a[N] ,b[N]; int main(){ LALIT; vector h(n); int m = 0; for(int h_i = 0;h_i < n;h_i++){ cin >> h[h_i]; } string w; cin >> w; rep(i,len(w)) { m=max(m,h[w[i]-'a']); } // cout<