let R () = let t = stdin.ReadLine().Split() |> Array.map int64 t.[0], t.[1] let rec gcd a b = if a < b then gcd b a else match b with | 0L -> a | b -> gcd b (a % b) let A, B = R () let G = let g = gcd A B let a = A / g let b = B / g (gcd (a + b) g) * g G |> printfn "%i"