package main import ( "fmt" "math" ) func main() { var x, y float64 _, _ = fmt.Scan(&x, &y) r2 := math.Pow(math.Abs(x), 2) + math.Pow(math.Abs(y), 2) r := math.Ceil(math.Sqrt(r2)) if r2 < r*r { fmt.Println(2 * r) } else { fmt.Println(2*r + 1) } }