open System let rec gcd a b = match b with | 0 -> a | _ -> gcd b (a%b) let N,K = let t = Console.ReadLine().Split() |> Array.map(int) t.[0],t.[1] [1..N-1] |> List.map (fun x -> gcd x (N-x)) |> List.max |> printfn "%i"