func f(s: []char, i: &int): int var res: int :: @g(s, &i) while(true) if(i >= ^s) ret res end if switch c(s[i]) case '+', '-' do i :+ 1 do res :+ @g(s, &i) * (c = '-' ?(-1, 1)) default do i :+ 1 ret res end switch end while ret 0 end func func g(s: []char, i: &int): int if(i >= ^s) ret 0 end if switch c(s[i]) case '0' to '9' do i :+ 1 ret c $ int - '0' $ int case '(' do i :+ 1 ret @f(s, &i) end switch ret 0 end func func main() var s: []char :: cui@input() var i: int :: 0 var ans: int :: @f(s, &i) do cui@print("\{ans}\n") end func