출처 | https://www.acmicpc.net/problem/1935
k = int(input())
word = input()#단어들을 저장하는 공간
num_list = [0] * k
for i in range(k):
num_list[i] = int(input())
stack = []
for i in word:
if 'A'<=i<='Z':
stack.append(num_list[ord(i)-ord('A')])
else:
n2 = stack.pop()
n1 = stack.pop()
if i == "+":
stack.append(n1+n2)
elif i == "-":
stack.append(n1-n2)
elif i == "/":
stack.append(n1/n2)
elif i == "*":
stack.append(n1*n2)
print('%.2f' %stack[0])