#include <bits/stdc++.h>
using namespace std;
string s;

//运算符优先级
int priority(char op){
    int p;
    if(op == '+' || op == '-') p = 1;
    if(op == '*' || op == '/') p = 2;
    return p;
}

double calculate(double a, double b, char op){
    double ret;
    if(op == '+') ret = a + b;
    if(op == '-') ret = a - b;
    if(op == '*') ret = a * b;
    if(op == '/') ret = a / b;
    return ret;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);

    while(getline(cin, s)){
        stack<double> st; // 操作数栈
        stack<char> op; // 运算符栈
        int index = 0, n = s.length();
        while(index < n){
            if(s[index] >= '0' && s[index] <= '9'){
                double x = s[index] - '0';
                index++;
                while(index < n && s[index] >= '0' && s[index] <= '9'){
                    x = x * 10 + s[index] - '0';
                    index++;
                }
                st.push(x);
            }else{
                //运算符栈op为空 或 当前运算符优先级比栈顶高 直接压栈
                if(op.empty() || priority(s[index]) > priority(op.top())){
                    op.push(s[index]);
                }else{
                    // 保证每次循环运算符栈都不为空
                    while(!op.empty() && priority(s[index]) <= priority(op.top())){
                        double b = st.top();
                        st.pop();
                        double a = st.top();
                        st.pop();
                        char p = op.top();
                        op.pop();
                        st.push(calculate(a, b, p));
                    }
                    op.push(s[index]);
                }
                index++;
            }
        }
        // 循环至运算符栈op为空时处理完毕
        while(!op.empty()){
            double b = st.top();
            st.pop();
            double a = st.top();
            st.pop();
            char p = op.top();
            op.pop();
            st.push(calculate(a, b, p));
        }
        cout << st.top() << '\n';
    }

    return 0;
}