﻿using System;
using System.Collections.Generic;

class XpressionAdvancedAlgorithms
{
    static string[] operators = { "-", "+", "*", "/", "(", ")" };

    static void ConvertToTokens(string input, string[] tokens)
    {
        for (int item = 0; item < input.Length; item++)
        {
            tokens[item] = input.Substring(item, 1);
        }
    }

    static void ShuntingYard(string[] tokens, Stack<string> theStack, Queue<string> output)
    {
        for (int i = 0; i < tokens.Length; i++)
        {
            if (Array.IndexOf(operators, tokens[i]) == -1)
            {
                output.Enqueue(tokens[i]);
            }
            else if (tokens[i] == "(")
            {
                theStack.Push(tokens[i]);
            }
            else if (tokens[i] == ")")
            {
                while (true)
                {
                    if (theStack.Peek() == "(")
                    {
                        theStack.Pop();
                        break;
                    }

                    output.Enqueue(theStack.Pop());
                }
            }
            else if (Array.IndexOf(operators, tokens[i]) != -1)
            {
                if (theStack.Count > 0 && theStack.Peek() != "(")
                {
                    output.Enqueue(theStack.Pop());
                    theStack.Push(tokens[i]);
                }
                else
                {
                    theStack.Push(tokens[i]);
                }
            }
        }

        while (theStack.Count > 0)
        {
            output.Enqueue(theStack.Pop());
        }
    }

    static decimal CalculateReversePolish(Queue<string> output)
    {
        Stack<decimal> numberStack = new Stack<decimal>();

        while (output.Count >= 1)
        {
            if (Array.IndexOf(operators, output.Peek()) == -1)
            {
                numberStack.Push(decimal.Parse(output.Dequeue()));
            }
            else if (Array.IndexOf(operators, output.Peek()) != -1)
            {
                string operation = output.Dequeue();
                decimal secondOperand = numberStack.Pop();
                decimal firstOperand = numberStack.Pop();
                decimal result = 0;

                if (operation == "-")
                {
                    result = firstOperand - secondOperand;
                    numberStack.Push(result);
                }
                else if (operation == "+")
                {
                    result = firstOperand + secondOperand;
                    numberStack.Push(result);
                }
                else if (operation == "*")
                {
                    result = firstOperand * secondOperand;
                    numberStack.Push(result);
                }
                else if (operation == "/")
                {
                    result = firstOperand / secondOperand;
                    numberStack.Push(result);
                }
            }
        }

        return numberStack.Pop();
    }

    static void Main()
    {
        // input and initializing
        string input = Console.ReadLine().Replace(" ", string.Empty).TrimEnd('=');
        
        string[] tokens = new string[input.Length];
        Queue<string> output = new Queue<string>();
        Stack<string> theStack = new Stack<string>();

        ConvertToTokens(input, tokens);
        ShuntingYard(tokens, theStack, output);        

        // calculating the reverse polish notation
        decimal result = CalculateReversePolish(output);
        Console.WriteLine("{0:F2}", result);
    }
}