let n = stdin.ReadLine() |> float let mutable x = 1. let mutable y = n let mutable cnt = 0 while x <= y do let m = sqrt (x ** 2. + y ** 2.) if m = n then if x <> y then cnt <- cnt + 2 else cnt <- cnt + 1 if m < n then x <- x + 1. else y <- y - 1. cnt |> printfn "%d"