#C8064. Evaluate Expression
Evaluate Expression
Evaluate Expression
You are given a string expression
that represents a mathematical expression consisting of non-negative integers and the operators +
and *
. The multiplication operator has higher precedence than the addition operator.
Your task is to evaluate the expression and output the result. The expression does not contain any parentheses and is guaranteed to be valid.
Mathematically, the expression can be interpreted as:
[ \text{result} = \sum_{i} \prod_{j} a_{ij} ]
where each term separated by +
is a product of one or more integers separated by *
.
inputFormat
The input consists of a single line containing a string expression
which includes non-negative integers and the operators +
and *
without any spaces.
outputFormat
Output a single integer which is the evaluated result of the expression. The output should be printed to standard output.
## sample2+3
5