let isPrime n = let limit = n |> float |> sqrt |> ceil |> int let rec check i = if i > limit then true elif n % i = 0 then false else check (i+1) if n > 2 then check 2 else 2 = n let n = stdin.ReadLine().Trim() |> int let mutable result = 0 for i in 2 .. n do if isPrime i then result <- result + i printfn "%d" result