open System let ri () = stdin.ReadLine() |> int let rla () = stdin.ReadLine().Split() |> Array.map int64 type Sol() = member this.Solve() = let [|T; A; B|] = rla() let rec gcd a b = if a = 0L then b else gcd (b % a) a T / A + T / B - T / (A /(gcd A B) * B) |> printfn "%d" () let mySol = new Sol() mySol.Solve()