//Strange Mathematical Expression
#include<bits/stdc++.h>
using namespace std;

stack<double> st;

int main(){
  string s;
  while(getline(cin, s)){
    double tmp=0.0;
    double c1, c2;
    for(int i=0; i<s.length(); i++){
      if(s[i]==' '){
        if(tmp!=0.0){st.push(tmp); tmp=0.0;}
      }
      else if('0'<=s[i]&&s[i]<='9'){tmp=tmp*10+(s[i]-'0');}
      else{
        c1=st.top(); st.pop();
        c2=st.top(); st.pop();
        if(s[i]=='+')st.push(c1+c2);
        if(s[i]=='-')st.push(c2-c1);
        if(s[i]=='*')st.push(c1*c2);
        if(s[i]=='/')st.push(c2/c1);
      }
    }
    printf("%.8f\n", st.top());
    while(!st.empty())st.pop();
  }
  return 0;
}