#include #define PI 3.14159265359 #define ff first #define ss second #define endl "\n" #define pb push_back #define MOD 1000000007 #define INF INT_MAX #define fre(x,y) for(int i=x;i #define sz(a) int((a).size()) #define space " " #define all(x) (x).begin(), (x).end() #define FILEIO freopen("input.in", "r", stdin);freopen("output.out", "w", stdout); #define ll long long int using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); vi v(26); fff(26)cin>>v[i]; string str; cin>>str; int max1 = 0; fff(str.length())max1 = max(v[str[i]-'a'],max1); cout<