Walk_alone is going to primary school! To train his computing ability, Weierstras gives him a game called Nerdle.
In this game, he should guess an equation of length $$$8$$$, and an equation is valid if and only if it satisfies the following rules:
For example, 5*4/4=05, 1--2=1+2 and -1*-2=02 are all valid equations, but 5/4*4=05, 5/4=10/8, 2+---1=1, 1+2+3=07, +12=10+2 or 1=3-2=01 are not.
Formally speaking, all valid equations must satisfy the following Extended Backus-Naur Form:
Equation := AddExpr '=' AddExpr
AddExpr := MulExpr | AddExpr ('+'|'-') MulExpr
MulExpr := Number | MulExpr ('*'|'/') Number
Number := ['-'] Digit {Digit}
Digit := '0'|'1'|'2'|'3'|'4'|'5'|'6'|'7'|'8'|'9'
Now Walk_alone has a pattern of length $$$8$$$, and he asks you to tell him the number of valid equations satisfying the pattern. The pattern consists only of digits, '+', '-', '*', '/', '=' and '?'. If the $$$i$$$-th character in the pattern is '?', it means the $$$i$$$-th character in the equation is not restricted, otherwise the character must be the same as the pattern.
The only line of the input contains a string of length $$$8$$$ as the pattern.
Output an integer indicating the number of equations.
?-?+1=?9
2
???*????
37305
All possible equations in the first example are 8-0+1=09 and 9-1+1=09.