#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
using namespace std;
typedef long long ll;
int a[5];
char str[100000];
int main(){
scanf("%d%d%d%d",&a[1],&a[2],&a[3],&a[4]);
scanf("%s",str);
int s = 0;
for(int i = 0;str[i];i++){
int s1 = str[i] - '0';
s += a[s1];
}
printf("%d\n",s);
return 0;
}
codeforces 431A - Black Square
最新推荐文章于 2019-08-27 15:29:02 发布