#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 );
			int n = -1;
			string c = "#";
			is2 >> n;
			if ( n != -1 )
			{
				s.push( n );
			}
			else
			{
				if ( s.empty() ) continue;
				c = token;
				double n2 = s.top();
				s.pop();
				double n1 = s.top();
				s.pop();

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

				s.push( n3 );
			}
		}

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