num = gets.chomp.to_i
op = ''
while true
    inp = gets.chomp
    if inp == '='
        puts num
        break
    end

    if /\d+/ =~ inp
        num = eval("#{num} #{op} #{inp}")
    else
        op = inp
    end
end