#include <iostream>
#include <sstream>
#include <stack>
using namespace std;
int main( void )
{
	while ( cin.eof() == false )
	{
		stack <double> s;

		string input;
		getline( cin, input );
		if ( cin.eof() ) break;

		string token;
		istringstream is( input );
		while ( is >> token )
		{
			istringstream is2( token );
			istringstream is3( token );
			int n;
			char c;
			if ( is2 >> n )
			{
				s.push( n );
			}
			else if ( is3 >> c )
			{
				double n1 = s.top();
				s.pop();
				double n2 = s.top();
				s.pop();
				double n3 = 0.0;

				if ( c == '+' )
				{
					n3 = n2 + n1;
				}
				else if ( c == '-' )
				{
					n3 = n2 - n1;
				}
				else if ( c == '*' )
				{
					n3 = n2 * n1;
				}
				else if ( c == '/' )
				{
					n3 = n2 / n1;
				}

				s.push( n3 );
			}
		}

		double answer = 0.0;
		if ( s.empty() == false )
		{
			answer = s.top();
		}
		cout.setf( ios::fixed );
		cout.precision( 6 );
		cout << answer << endl;
	}
	return 0;
}