#include <iostream>
#include <string>
#include <stack>

using namespace std;

class CTokenizer
{
  public:
    CTokenizer( string &s )
    {
        _s     = s;
        _ch = strtok( (char*)_s.c_str(), " " );
    }

    char * get()       { return _ch; }
    bool   next()      { _ch = strtok( NULL, " " ); return _ch; }
    bool   is_value()  { return sscanf( _ch, "%f", &_f ); }
    float  get_value() { return _f; }

  protected:
    string _s;
    float  _f;
    char  *_ch;
};

class CRpnCalc
{
  public:
    CRpnCalc( string &s ) { _tok = new CTokenizer( s ); }
    ~CRpnCalc()           { delete _tok; }

    float eval()
    {
        while ( NULL != _tok->get() )
        {
            if ( _tok->is_value() )
                _st.push( _tok->get_value() );
            else
            {
                float f2 = _pop();
                float f1 = _pop();

                _st.push( _calc( f1, f2, _tok->get() ) );
            }

           _tok->next();
        }

        if ( !_st.empty() )
            return _pop();

        return 0;
    }

  protected:
    stack < float > _st;
    CTokenizer * _tok;

    float _pop()
    {
        float f = 0;

        if ( !_st.empty() )
        {
            f = _st.top();
            _st.pop();
        }
        else
            cout << "Buffer underrun!" << endl;

        return f;
    }

    float _calc( float f1, float f2, char * op )
    {
        float f = 0;

        switch( op[0] )
        {
            case '+': f = f1 + f2; break;
            case '-': f = f1 - f2; break;
            case '*': f = f1 * f2; break;
            case '/': f = f1 / f2; break;
            default:
                cout << "Invalid operator '" << op[0] << "'" << endl;
                break;
        }

        return f;
    }
   
};

int main()
{
    while ( true )
    {
        string s;
        getline( cin, s );

        if ( strlen( s.c_str() ) > 0 )
        {
            CRpnCalc rpn( s );
            cout << rpn.eval() << endl;
        }
    }

    return 0;
}

