newton/solutions/431A.py

8 lines
101 B
Python
Raw Normal View History

2025-01-11 11:41:29 +00:00
a = input().split(' ')
s = input()
count = 0
for i in s:
count += int(a[int(i)-1])
print(count)