(define (solve) (receive (x y) (apply values (map string->number (string-split (read-line) #\space))) (let ((r (ceiling->exact (sqrt (+ (expt x 2) (expt y 2)))))) (if (= (+ (expt x 2) (expt y 2)) (expt r 2)) (+ 1 (* 2 r)) (* 2 r))))) (begin (display (solve)) (newline))