s=input()
d=s.split()

operater=["+","*","-","/"]
cal=[]
k=0
for i in range(len(d)):
    if d[i] not in operater:
        cal.append(int(d[i]))
        k+=1
    else:
        j=operater.index(d[i])
        if j==0:
            x=cal[k-1]+cal[k-2]
        elif j==1:
            x=cal[k-1]*cal[k-2]
        elif j==2:
            x=cal[k-2]-cal[k-1]
        else:
            x=cal[k-2]/cal[k-1]
        cal.pop()
        cal.pop()
        cal.append(x)
        print
        k-=1
print(cal[0]) s=input() s input() input d=s.split() d s.split() s.split s split operater=["+","*","-","/"] operater ["+","*","-","/"] "+" "*" "-" "/" cal=[] cal [] k=0 k 0 for i in range(len(d)):
    if d[i] not in operater:
        cal.append(int(d[i]))
        k+=1
    else:
        j=operater.index(d[i])
        if j==0:
            x=cal[k-1]+cal[k-2]
        elif j==1:
            x=cal[k-1]*cal[k-2]
        elif j==2:
            x=cal[k-2]-cal[k-1]
        else:
            x=cal[k-2]/cal[k-1]
        cal.pop()
        cal.pop()
        cal.append(x)
        print
        k-=1 i range(len(d)) range len(d) len d if d[i] not in operater:
        cal.append(int(d[i]))
        k+=1
    else:
        j=operater.index(d[i])
        if j==0:
            x=cal[k-1]+cal[k-2]
        elif j==1:
            x=cal[k-1]*cal[k-2]
        elif j==2:
            x=cal[k-2]-cal[k-1]
        else:
            x=cal[k-2]/cal[k-1]
        cal.pop()
        cal.pop()
        cal.append(x)
        print
        k-=1 d[i] not in operater d[i] d i operater cal.append(int(d[i])) cal.append cal append int(d[i]) int d[i] d i k+=1 k 1 j=operater.index(d[i]) j operater.index(d[i]) operater.index operater index d[i] d i if j==0:
            x=cal[k-1]+cal[k-2]
        elif j==1:
            x=cal[k-1]*cal[k-2]
        elif j==2:
            x=cal[k-2]-cal[k-1]
        else:
            x=cal[k-2]/cal[k-1]
         j==0 j 0 x=cal[k-1]+cal[k-2] x cal[k-1]+cal[k-2] cal[k-1] cal k-1 k 1 cal[k-2] cal k-2 k 2 elif j==1:
            x=cal[k-1]*cal[k-2]
         j==1 j 1 x=cal[k-1]*cal[k-2] x cal[k-1]*cal[k-2] cal[k-1] cal k-1 k 1 cal[k-2] cal k-2 k 2 elif j==2:
            x=cal[k-2]-cal[k-1]
         j==2 j 2 x=cal[k-2]-cal[k-1] x cal[k-2]-cal[k-1] cal[k-2] cal k-2 k 2 cal[k-1] cal k-1 k 1 x=cal[k-2]/cal[k-1] x cal[k-2]/cal[k-1] cal[k-2] cal k-2 k 2 cal[k-1] cal k-1 k 1 cal.pop() cal.pop cal pop cal.pop() cal.pop cal pop cal.append(x) cal.append cal append x print k-=1 k 1 print(cal[0]) print cal[0] cal 0 k=0 0 k k+=1 1 k j=operater.index(d[i]) operater.index(d[i]) j k-=1 1 k cal=[] [] cal s=input() input() s x=cal[k-2]/cal[k-1] cal[k-2]/cal[k-1] x d=s.split() s.split() d operater=["+","*","-","/"] ["+","*","-","/"] operater x=cal[k-1]*cal[k-2] cal[k-1]*cal[k-2] x x=cal[k-1]+cal[k-2] cal[k-1]+cal[k-2] x x=cal[k-2]-cal[k-1] cal[k-2]-cal[k-1] x
s=input()
d=s.split()

operater=["+","*","-","/"]
cal=[]
k=0
for i in range(len(d)):
    if d[i] not in operater:
        cal.append(int(d[i]))
        k+=1
    else:
        j=operater.index(d[i])
        if j==0:
            x=cal[k-1]+cal[k-2]
        elif j==1:
            x=cal[k-1]*cal[k-2]
        elif j==2:
            x=cal[k-2]-cal[k-1]
        else:
            x=cal[k-2]/cal[k-1]
        cal.pop()
        cal.pop()
        cal.append(x)
        print
        k-=1
print(cal[0])
