xs=gets.chomp.gsub(/[*+]/,"@\\&@").split'@' x=xs[0].to_i i=-1 xs[i+=2]=="+"?x*=xs[i+1].to_i: x+=xs[i+1].to_i while i