P2788 Math 1 (math1) - Addition and Subtraction Expressions

Background

Noob HansBug scratched his head countless times in the math exam, but his mind was still blank.

Description

At long last, HansBug has made it to the final math problem: a jumble of addition and subtraction expressions. Success seems within reach. However, his brain cells and RP (luck) are completely drained, so this important task is now up to you.

Input Format

One line containing an addition/subtraction expression given as a string (the number in each term is in the range $0 \sim 32767$).

Output Format

A single integer, which is the computed result (guaranteed that the result will not exceed the range of a long integer).

Explanation/Hint

The testdata guarantees that the string length does not exceed $60000$. Translated by ChatGPT 5