#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctype.h>
#include <stack>
using namespace std;

char buf[100000];

int main() {
  while (1) {
    if (fgets(buf, sizeof(buf), stdin) == NULL) return 0;

    char *p;
    p = strchr(buf, '\n');
    if (p) *p = '\0';

    stack<double> st;
    int n = strlen(buf);
    p = buf;
    while (p < buf+n) {
      if (*p == ' ') {
        ++p;
        continue;
      }

      char *next;
      long t = strtol(p, &next, 10);
      if (p != next) {
        st.push(t);
        p = next;
      } else {
        double b = st.top(); st.pop();
        double a = st.top(); st.pop();

        if (*p == '+') st.push(a+b);
        else if (*p == '-') st.push(a-b);
        else if (*p == '*') st.push(a*b);
        else if (*p == '/') st.push(a/b);
        else {
          st.push(a);
          st.push(b);
        }
        ++p;
      }
    }

    printf("%f\n", st.top());
  }
}