#include<iostream>
#include<string>
#include<stack>
#include<cstdio>
using namespace std;
int main()
{
    string s;
    while(getline(cin,s))
    {
        if(cin.eof())break;
        cout << s << endl;
        int len = s.size();
        stack<double> nums;
        stack<char> op;
        double temp=0,num1=0,num2=0;
        int f = 0;
        //cout << len << endl;
        for(int i=0;i<len;i++)
        {
            if(s[i]=='+')
            {
                num2 = nums.top(); nums.pop();
                num1 = nums.top(); nums.pop();
                num1 += num2; nums.push(num1);
                continue;
            }
            if(s[i]=='-')
            {
                num2 = nums.top(); nums.pop();
                num1 = nums.top(); nums.pop();
                num1 -= num2; nums.push(num1);
                continue;
            }
            if(s[i]=='*')
            {

                num2 = nums.top(); nums.pop();
                num1 = nums.top(); nums.pop();
                num1 *= num2; nums.push(num1);
                continue;
            }
            if(s[i]=='/')
            {
                num2 = nums.top(); nums.pop();
                num1 = nums.top(); nums.pop();
                num1 /= num2; nums.push(num1);
                continue;
            }
            if(s[i]>='0'&&s[i]<='9')
            {
                f = 1;
                //cout << s[i] << endl;
                temp = temp*10 + (double)(s[i]-'0');
                continue;
            }
            if(f==1&& (s[i]==' '|| i==len-1))
            {
                nums.push(temp);
                cout << temp << endl;
                temp = 0;
                f= 0;
                continue;
            }
        }
        printf("%.6f\n",nums.top());
        //cout << (nums.top())<<endl;
    }
    return 0;
}