defmodule Main do def input, do: IO.read(:line) |> String.trim def ii, do: input() |> String.to_integer def li, do: input() |> String.split |> Enum.map(&String.to_integer/1) def yn(b), do: IO.puts(if b, do: "Yes", else: "No") def primes() do Stream.iterate(2, &(&1 + 1)) |> Stream.unfold(fn s -> p = s |> Enum.at(0) rest = s |> Stream.filter(fn x -> rem(x, p) != 0 end) {p, rest} end) end def main do n = ii() ps = primes() |> Enum.take_while(fn x -> x <= n end) # IO.inspect ps IO.puts length(ps) end end