s=gets.chomp a=s.scan(/((?:-|\+)?\d+)(\+|-)((?:-|\+)?\d+)/) a=a[0] a[1]=a[1]=="-" ? "+" : "-" p eval(a*"")