#include<iostream>
#include<stack>
using namespace std;
int main() {
string s;
getline(cin, s);
stack<char> z;//保存运算符
stack<double> t;//保存数字
string temp;
for (int i = 0; i < s.size(); i++) {
if (s[i] == ' ')continue;
if (s[i] >= '0' && s[i] <= '9') { //大于个位数
temp += s[i];
while (i < s.size()) {
if (s[i + 1] >= '0' && s[i + 1] <= '9') {
temp += s[i + 1];
i++;
} else break;
}
int x = atoi(temp.c_str());//字符串转int!!
double y = (double)x;
t.push(y);
temp.clear();
} else { //保留运算符
if (z.empty()) {
z.push(s[i]);
continue;
}
while (z.top() == '*' || z.top() == '/') {
double x = t.top();
t.pop();
double y = t.top();
t.pop();
if (z.top() == '*') {
x = x * y;
t.push(x);
} else {
x = y / x;
t.push(x);
}
z.pop();
if (z.empty())break;
}
if ((s[i] == '-' || s[i] == '+') && !z.empty()) {
while (z.top() == '+' || z.top() == '-') {
double x = t.top();
t.pop();
double y = t.top();
t.pop();
if (z.top() == '+') {
x = x + y;
t.push(x);
} else {
x = y - x;
t.push(x);
}
z.pop();
if (z.empty())break;
}
}
z.push(s[i]);
}
}
while (!z.empty()) {
double x = t.top();
t.pop();
double y = t.top();
t.pop();
if (z.top() == '*') {
x = x * y;
t.push(x);
} else if (z.top() == '/') {
x = y / x;
t.push(x);
} else if (z.top() == '+') {
x = x + y;
t.push(x);
} else if (z.top() == '-') {
x = y - x;
t.push(x);
}
z.pop();
}
printf("%.2f\n", t.top());
}