import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
} import java.io.*; io.* java import java.util.*; util.* java public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
} Main public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    } main {
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    } Deque<String> formula = new ArrayDeque<String>(); formula new ArrayDeque<String>() Scanner scan = new Scanner(System.in); scan new Scanner(System.in) while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        } scan.hasNext() scan.hasNext scan {
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        } String input = scan.next(); input scan.next() scan.next scan switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            } input case "+": "+" case "+": input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())) input String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())) String.valueOf String Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()) Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula break; case "-": "-" case "-": input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())) input String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll())) String.valueOf String -1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()) -1*Double.parseDouble(formula.poll()) -1 1 Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula break; case "/": "/" case "/": input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())) input String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())) String.valueOf String 1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()) 1.0/Double.parseDouble(formula.poll()) 1.0 Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula break; case "*": "*" case "*": input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())) input String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll())) String.valueOf String Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()) Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula break; formula.push(input) formula.push formula input double ans = Double.parseDouble(formula.poll()); ans Double.parseDouble(formula.poll()) Double.parseDouble Double formula.poll() formula.poll formula if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        } ans==(int)ans ans (int)ans {
            System.out.println((int)ans);
        } System.out.println((int)ans) System.out.println System.out System System.out (int)ans {
            System.out.println(ans);
        } System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
} public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
} Main
import java.io.*;
import java.util.*;
public class Main{
    public static void main(String[] args){
        Deque<String> formula = new ArrayDeque<String>();
        Scanner scan = new Scanner(System.in);
        while(scan.hasNext()){
            String input = scan.next();
            switch(input){
                case "+":
                    input = String.valueOf(Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));
                    break;
                case "-":
                    input = String.valueOf(-1*Double.parseDouble(formula.poll())+Double.parseDouble(formula.poll()));                    
                    break;
                case "/":
                    input = String.valueOf(1.0/Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
                case "*":
                    input = String.valueOf(Double.parseDouble(formula.poll())*Double.parseDouble(formula.poll()));
                    break;
            }
            formula.push(input);
        }
        double ans = Double.parseDouble(formula.poll());
        if(ans==(int)ans){
            System.out.println((int)ans);
        }else{
            System.out.println(ans);
        }
    }
}