Professor Octastichs has invented a new programming language called Smeech. A Smeech expression is one of the following:
(p e1 e2), where p is a real number between 0 and 1 (inclusive) and e1, e2 are Smeech expressions.The value represented by a Smeech expression is defined as follows:
(p e1 e2) represents x + y with probability p, and x - y with probability 1 - p, where x is the value of e1 and y is the value of e2.Each add-or-subtract choice is made independently. Given a Smeech expression, compute its expected value.
The input contains several Smeech expressions, one per line, followed by a line containing (), which marks the end of the input.
For each expression, output its expected value rounded to two decimal places.