n=input().split()
c=0
while len(n)!=1:
	if n[c]=='+':
		n[c-2]=int(n[c-2])+int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='-':
		n[c-2]=int(n[c-2])-int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='*':
		n[c-2]=int(n[c-2])*int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='/':
		n[c-2]=int(n[c-2])/int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	c+=1
a=int(n[0])
print(a) n=input().split() n input().split() ().split () input split c=0 c 0 while len(n)!=1:
	if n[c]=='+':
		n[c-2]=int(n[c-2])+int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='-':
		n[c-2]=int(n[c-2])-int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='*':
		n[c-2]=int(n[c-2])*int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='/':
		n[c-2]=int(n[c-2])/int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	c+=1 len(n)!=1 len(n) len n 1 if n[c]=='+':
		n[c-2]=int(n[c-2])+int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='-':
		n[c-2]=int(n[c-2])-int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='*':
		n[c-2]=int(n[c-2])*int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='/':
		n[c-2]=int(n[c-2])/int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	 n[c]=='+' n[c] n c '+' n[c-2]=int(n[c-2])+int(n[c-1]) n[c-2] n c-2 c 2 int(n[c-2])+int(n[c-1]) int(n[c-2]) int n[c-2] n c-2 c 2 int(n[c-1]) int n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 c=0 c 0 elif n[c]=='-':
		n[c-2]=int(n[c-2])-int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	 n[c]=='-' n[c] n c '-' n[c-2]=int(n[c-2])-int(n[c-1]) n[c-2] n c-2 c 2 int(n[c-2])-int(n[c-1]) int(n[c-2]) int n[c-2] n c-2 c 2 int(n[c-1]) int n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 c=0 c 0 elif n[c]=='*':
		n[c-2]=int(n[c-2])*int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	 n[c]=='*' n[c] n c '*' n[c-2]=int(n[c-2])*int(n[c-1]) n[c-2] n c-2 c 2 int(n[c-2])*int(n[c-1]) int(n[c-2]) int n[c-2] n c-2 c 2 int(n[c-1]) int n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 c=0 c 0 elif n[c]=='/':
		n[c-2]=int(n[c-2])/int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	 n[c]=='/' n[c] n c '/' n[c-2]=int(n[c-2])/int(n[c-1]) n[c-2] n c-2 c 2 int(n[c-2])/int(n[c-1]) int(n[c-2]) int n[c-2] n c-2 c 2 int(n[c-1]) int n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 del n[c-1] n[c-1] n c-1 c 1 c=0 c 0 c+=1 c 1 a=int(n[0]) a int(n[0]) int n[0] n 0 print(a) print a n=input().split() input().split() n c+=1 1 c a=int(n[0]) int(n[0]) a c=0 0 c c=0 0 c c=0 0 c c=0 0 c c=0 0 c
n=input().split()
c=0
while len(n)!=1:
	if n[c]=='+':
		n[c-2]=int(n[c-2])+int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='-':
		n[c-2]=int(n[c-2])-int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='*':
		n[c-2]=int(n[c-2])*int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	elif n[c]=='/':
		n[c-2]=int(n[c-2])/int(n[c-1])
		del n[c-1]
		del n[c-1]
		c=0
	c+=1
a=int(n[0])
print(a)
