calc :: Int -> IO Int
calc init = do
    opStr <- getLine
    if opStr == "="
        then return init
        else do
            numStr <- getLine
            let n = read numStr :: Int
            let res = case opStr of
                           "+" -> init + n
                           "-" -> init - n
                           "*" -> init * n
                           "/" -> div init n
            calc res

main = do
    initStr <- getLine
    res <- calc (read initStr :: Int)
    print res

