#C4147. FlexiScript Expression Evaluator

    ID: 47653 Type: Default 1000ms 256MiB

FlexiScript Expression Evaluator

FlexiScript Expression Evaluator

You are given a single-line string representing a FlexiScript expression. The expression consists of function calls that can be nested arbitrarily. The available functions are defined as follows:

  • $$\text{add}(x, y) = x + y$$
  • $$\text{subtract}(x, y) = x - y$$
  • $$\text{multiply}(x, y) = x \times y$$
  • $$\text{divide}(x, y) = \left\lfloor \frac{x}{y} \right\rfloor$$   (It is guaranteed that y is not 0.)
  • $$\text{power}(x, y) = x^{y}$$
  • $$\text{sqrt}(x) = \left\lfloor \sqrt{x} \right\rfloor$$   (x is non-negative)

Note that the function names are case-insensitive. Your task is to evaluate the given expression and print the resulting integer.

inputFormat

The input consists of a single line from standard input containing a valid FlexiScript expression. The expression may include spaces and is guaranteed to be syntactically correct.

outputFormat

Output a single integer to standard output which is the result of evaluating the input expression.

## sample
add(3, 5)
8