s = list(input().split())
keep =[]
for i in range(len(s)):
  if s[i] == "+":
    keep.append(keep[-1]+keep[-2])
    del keep[-3:-1]
  elif s[i] == "-":
    keep.append(keep[-2]-keep[-1])
    del keep[-3:-1]
  elif s[i] == "*":
    keep.append(keep[-2]*keep[-1])
    del keep[-3:-1]
  elif s[i] == "/":
    keep.append(keep[-2]/keep[-1])
    del keep[-3:-1]
  else:
    keep.append(int(s[i]))
print(keep[-1]) s = list(input().split()) s list(input().split()) list input().split() ().split () input split keep =[] keep [] for i in range(len(s)):
  if s[i] == "+":
    keep.append(keep[-1]+keep[-2])
    del keep[-3:-1]
  elif s[i] == "-":
    keep.append(keep[-2]-keep[-1])
    del keep[-3:-1]
  elif s[i] == "*":
    keep.append(keep[-2]*keep[-1])
    del keep[-3:-1]
  elif s[i] == "/":
    keep.append(keep[-2]/keep[-1])
    del keep[-3:-1]
  else:
    keep.append(int(s[i])) i range(len(s)) range len(s) len s if s[i] == "+":
    keep.append(keep[-1]+keep[-2])
    del keep[-3:-1]
  elif s[i] == "-":
    keep.append(keep[-2]-keep[-1])
    del keep[-3:-1]
  elif s[i] == "*":
    keep.append(keep[-2]*keep[-1])
    del keep[-3:-1]
  elif s[i] == "/":
    keep.append(keep[-2]/keep[-1])
    del keep[-3:-1]
  else:
    keep.append(int(s[i])) s[i] == "+" s[i] s i "+" keep.append(keep[-1]+keep[-2]) keep.append keep append keep[-1]+keep[-2] keep[-1] keep -1 keep[-2] keep -2 del keep[-3:-1] keep[-3:-1] keep -3:-1 -3 -1 elif s[i] == "-":
    keep.append(keep[-2]-keep[-1])
    del keep[-3:-1]
   s[i] == "-" s[i] s i "-" keep.append(keep[-2]-keep[-1]) keep.append keep append keep[-2]-keep[-1] keep[-2] keep -2 keep[-1] keep -1 del keep[-3:-1] keep[-3:-1] keep -3:-1 -3 -1 elif s[i] == "*":
    keep.append(keep[-2]*keep[-1])
    del keep[-3:-1]
   s[i] == "*" s[i] s i "*" keep.append(keep[-2]*keep[-1]) keep.append keep append keep[-2]*keep[-1] keep[-2] keep -2 keep[-1] keep -1 del keep[-3:-1] keep[-3:-1] keep -3:-1 -3 -1 elif s[i] == "/":
    keep.append(keep[-2]/keep[-1])
    del keep[-3:-1]
   s[i] == "/" s[i] s i "/" keep.append(keep[-2]/keep[-1]) keep.append keep append keep[-2]/keep[-1] keep[-2] keep -2 keep[-1] keep -1 del keep[-3:-1] keep[-3:-1] keep -3:-1 -3 -1 keep.append(int(s[i])) keep.append keep append int(s[i]) int s[i] s i print(keep[-1]) print keep[-1] keep -1 s = list(input().split()) list(input().split()) s keep =[] [] keep
s = list(input().split())
keep =[]
for i in range(len(s)):
  if s[i] == "+":
    keep.append(keep[-1]+keep[-2])
    del keep[-3:-1]
  elif s[i] == "-":
    keep.append(keep[-2]-keep[-1])
    del keep[-3:-1]
  elif s[i] == "*":
    keep.append(keep[-2]*keep[-1])
    del keep[-3:-1]
  elif s[i] == "/":
    keep.append(keep[-2]/keep[-1])
    del keep[-3:-1]
  else:
    keep.append(int(s[i]))
print(keep[-1])
