package main.java;
import java.util.Scanner;
import java.util.Stack;
public class evaluate {
public static Stackstack=new Stack();
public static Stackstack1=new Stack();
public static boolean isNumeric(char c){
if((c>='0'&&c<='9')||c=='.'){
return true;
}else{
return false;
}
}
public static void cal(){
double temp=stack.peek();
stack.pop();
double temp2=stack.peek();
stack.pop();
if(stack1.peek()=='+'){
temp2+=temp;
stack.push(temp2);
}
if(stack1.peek()=='-'){
temp2-=temp;
stack.push(temp2);
} if(stack1.peek()=='*'){
temp2*=temp;
stack.push(temp2);
}
if(stack1.peek()=='/'){
try{
temp2/=temp;
stack.push(temp2);
}catch (Exception e){
e.printStackTrace();
}
}
stack1.pop();
}
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
String s=sc.nextLine();
StringBuffer num=new StringBuffer("");
char c;
for(int i=0;i=1&&s.charAt(i-1)!=')'){
double n = Double.parseDouble(num.toString());
stack.push(n);
}
if (c == ')') {
while (stack1.peek() != '(') {
cal();
}
stack1.pop();
}
if (c == '+' || c == '-') {
if (!stack1.isEmpty() && stack1.peek() != '(') {
cal();
}
stack1.push(c);
}
if (c == '*' || c == '/') {
stack1.push(c);
}
num.delete(0, num.length());
}
}
}
if(!stack1.isEmpty()){
cal();
}
System.out.println(stack.peek());
}
}