open System type Sol() = member this.Solve() = let [|N;L|] = stdin.ReadLine().Split() |> Array.map int let NL = int64 N let LL = int64 L let isPrime = Array.create (L/2 + 100) true let mutable primes:int list = [] isPrime.[0] <- false isPrime.[1] <- false let ul1 = L/2 |> double |> sqrt |> int |> (+) 1 let ul2 = L/2 + 99 for i = 2 to ul1 do if isPrime.[i] = true then for j in (i*i)..i..ul2 do isPrime.[j] <- false let mutable ans:int64 = 0L // printfn "%d" ans for i = 2 to (L/2 + 1) do if isPrime.[i] = true && LL >= ((NL-1L) * (int64 i)) then ans <- ans + (int64 (( L - ((N-1) * i) + 1 ))) printfn "%d" ans let mySol = new Sol() mySol.Solve()