Expressions are commonly written in infix notation, with a binary operator between its operands, as in 1+2 or 7*(5-3). In prefix notation the operator comes before its operands, as in + 1 2 or * 7 - 5 3. In postfix notation the operator comes after its operands, as in 1 2 + or 7 5 3 - *. Prefix and postfix notation do not use parentheses.
Farmer John's cows often mix these three notations. They write expressions in cowfix, using single-digit numbers and the binary operators + and -. An expression may be interpreted using any mixture of infix, prefix, and postfix rules. For example, +54+-82 can be evaluated at least two ways:
+ 5 4 + - 8 2 = 9 + - 8 2 = 9 + 6 = 15
+ 5 4 + - 8 2 = + 9 - 8 2 = + 1 2 = 3
The expression 9-4+3 evaluates to both $2$ and $8$. Given a cowfix expression, determine the number of distinct values it may evaluate to. The input is guaranteed to be a syntactically valid cowfix expression.
Input
One string of at most 80 characters, containing no blanks.
Output
One line containing the number of different possible values.
Examples
Input 1
+54+-82
Output 1
2