l=[0]*1000
c=0
s=input().split()
for i in s:
	if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1
print(l[0]) l=[0]*1000 l [0]*1000 [0] 0 1000 c=0 c 0 s=input().split() s input().split() ().split () input split for i in s:
	if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1 i s if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1 i=="+" i "+" l[c-2]=l[c-2]+l[c-1] l[c-2] l c-2 c 2 l[c-2]+l[c-1] l[c-2] l c-2 c 2 l[c-1] l c-1 c 1 c=c-1 c c-1 c 1 elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	 i=="-" i "-" l[c-2]=l[c-2]-l[c-1] l[c-2] l c-2 c 2 l[c-2]-l[c-1] l[c-2] l c-2 c 2 l[c-1] l c-1 c 1 c=c-1 c c-1 c 1 elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	 i=="*" i "*" l[c-2]=l[c-2]*l[c-1] l[c-2] l c-2 c 2 l[c-2]*l[c-1] l[c-2] l c-2 c 2 l[c-1] l c-1 c 1 c=c-1 c c-1 c 1 l[c]=int(i) l[c] l c int(i) int i c=c+1 c c+1 c 1 print(l[0]) print l[0] l 0 c=c-1 c-1 c c=0 0 c c=c+1 c+1 c c=c-1 c-1 c l=[0]*1000 [0]*1000 l s=input().split() input().split() s c=c-1 c-1 c
l=[0]*1000
c=0
s=input().split()
for i in s:
	if i=="+":
		l[c-2]=l[c-2]+l[c-1]
		c=c-1
	elif i=="-":
		l[c-2]=l[c-2]-l[c-1]
		c=c-1
	elif i=="*":
		l[c-2]=l[c-2]*l[c-1]
		c=c-1
	else:
		l[c]=int(i)
		c=c+1
print(l[0])
