#include <iostream>
#include <cstdio>
#include <stack>
#include <string>
using namespace std;
string target;

bool isOperator(char r) {
    if(r == '+' || r == '-' || r == '*' || r == '/') return(true);
    return(false);
}

double toDouble(string s) {
    double weight = 1.0, ret = 0;
    for(int r = (int)s.length() - 1; r >= 0; r--) {
        ret += (s[r] - '0') * weight;
        weight *= 10;
    }
    return(ret);
}

void solve() {
    stack<double> porland;
    string check = "";
    for(int r = 0; r < target.length(); r++) {
        if(target[r] != ' ' && !isOperator(target[r])) {
            check += target[r];
        } else if(isOperator(target[r])) {
            double a = porland.top(); porland.pop();
            double b = porland.top(); porland.pop();
            switch(target[r]) {
                case '+': porland.push(b + a); break;
                case '-': porland.push(b - a); break;
                case '*': porland.push(b * a); break;
                case '/': porland.push(b / a); break;
            }
        } else {
            if(!check.length()) continue;
            double temp = toDouble(check);
            porland.push(temp);
            check = "";
        }
    }
    printf("%.6f\n", porland.top()); porland.pop();
}

int main(void) {
    while(getline(cin, target)) {
        solve();
    }
    return(0);
}