package main import ( "fmt" ) func main() { var c string fmt.Scan(&c) mode := 0 num := 0 flag := '+' op := '+' A := 0 for i := 0; i < len(c); i++ { if '0' <= c[i] && c[i] <= '9' { num = num * 10 + int(c[i] - '0') mode = 1 } else { if mode == 0 { if c[i] == '-' { flag = rune(c[i]) } } else if mode == 1 { A = num if flag == '-' { A *= -1 } num = 0 flag = '+' if c[i] == '+' { op = '-' } else { op = '+' } mode = 0 } } } B := num if flag == '-' { B *= -1 } if op == '+' { fmt.Println(A + B) } else { fmt.Println(A - B) } }