 #include<iostream>
 #include<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 #include<deque>
 #include<functional>
 #include<utility>
 #include<list>
 
 using namespace std;
 
 int stringToint(const string S)
 {  
    int result=0;
    if(S[0]=='-')
    {
      for(int i=1;i<S.length();i++)
      {
        result=10*result+(S[i]-'0');        
      }             
      result=-result;
    }
    else
    {
      for(int i=0;i<S.length();i++)
      { 
        result=10*result+(S[i]-'0');      
      }
    }  
    return result;  
 }  
 
 int main()
 {
   string s;
   string word;
   while(getline(cin,s)!=EOF)
   {
     stack<double> mm;
     for(int i=0;i<s.length();i++)
     {
       word="";
       while((i<s.length())&&(!isspace(s[i])))
       { 
         word+=s[i];
         i++;
       }
       if((word.length()==2&&word[0]=='-')||(isdigit(word[0])))  
       {
         double kk=1.0*(stringToint(word));
         
         mm.push(kk);                                                          
       }         
       else if(word=="+"||word=="-"||word=="*"||word=="/")
       {
         double a=mm.top();
         mm.pop();
         double b=mm.top();
         mm.pop();
         double result;
         if(word=="+") result=b+a;
         else if(word=="-") result=b-a;
         else if(word=="*") result=b*a;
         else result=1.0*b/a;
         mm.push(result);     
       } 
     }  
     double final_result=mm.top();
     printf("%.10lf\n",final_result);           
   }  
   //while(1);
   return 0;
 }

 
  