#include <iostream>
#include <cctype>
#include <string>
#include <cassert>
enum class Type : char {
	Num, Pos = '+', Neg = '-', Mul = '*', Div = '/', LP = '(', RP = ')', End = '='
};

struct Token {
	Type type;
	double num;
};

class Expression {
public:
	Expression(std::istream *s) :is{ s } {};
	Token &current() {
		return _current;
	}
	Token get() {
		char c;
		if (!((*is).get(c))) return _current = { Type::End };
		switch (c) {
		case '+':
		case '-':
		case '*':
		case '/':
		case '(':
		case ')':return _current = { static_cast<Type>(c) }; break;
		case '=':
		case '\n': return _current = { Type::End }; break;
		default:
			if (isdigit(c)) {
				std::string str;
				str.push_back(c);
				while ((*is).get(c)) {
					if (isdigit(c)) {
						str.push_back(c);
					}
					else {
						(*is).putback(c);
						return _current = { Type::Num, std::stod(str) };
					}
				}
				return _current = { Type::Num, std::stod(str) };
			}
			else throw;
		}
	}
private:
	std::istream *is;
	Token _current{ Type::End };
};
double execute_sub(Expression &, const bool &);
double single_value(Expression &exp, const bool &use_get) {
	double left;
	if (use_get) exp.get();
	switch (exp.current().type) {
	case Type::Num:
		return exp.current().num;
	case Type::Neg:
		return -single_value(exp, true);
	case Type::LP:
		left = execute_sub(exp, true);
		exp.get();
		exp.current() = { Type::Num, left };
		return left;
	default: throw;
	}
}
double execute_pri(Expression &exp, const bool &use_get) {
	if (use_get) exp.get();
	auto left = single_value(exp, false);
	switch (exp.get().type) {
	case Type::Mul:
		return left * execute_pri(exp, true);
	case Type::Div:
		return left / execute_pri(exp, true);
	default:
		return left;
	}
}
double execute_sub(Expression &exp, const bool &use_get) {
	if (use_get) exp.get();
	auto left = execute_pri(exp, false);
	switch (exp.current().type) {
	case Type::Pos:
		return left + execute_sub(exp, true);
	case Type::Neg:
		return left - execute_sub(exp, true);
	default:
		return left;
	}
}
double execute(Expression &exp) {
	exp.get();
	return execute_sub(exp, false);
}
int main() {
	Expression express(&std::cin);
	std::cout << execute(express) << std::endl;
	return 0;
}