let primLazy = let odds = Seq.initInfinite (fun i -> 2 * i + 1) let rec f src = let (x, xs) = (Seq.head src, Seq.skip 1 src) seq { yield x for i in f xs do if i % x <> 0 then yield i } seq { yield 2 yield! f (Seq.skip 1 odds) } let N = stdin.ReadLine() |> int primLazy |> Seq.takeWhile(fun x -> x <= N) |> Seq.sum |> stdout.WriteLine