let () =
  let n = read_int () in
  let rec read result =
    let op = read_line () and
        m = read_int in
    if op = "+" then
      read (result + (m ()))
    else if op = "-" then
      read (result - (m ()))
    else if op = "*" then
      read (result * (m ()))
    else if op = "/" then
      read (result / (m ()))
    else
      result
  in
  Printf.printf "%d\n" (read n)
;;