S = gets S =~ /([+-]?\d+)([+-])([+-]?\d+)/ puts eval(%[#{$1}#{$2.tr("+-", "-+")}#{$3}])