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 sieve(n) do t = :ets.new(:prime, [:set, :protected]) for i <- 2..n do case :ets.lookup(t, i) do [] -> for j <- i+i..n//i do :ets.insert(t, {j}) end _ -> nil end end for i <- 2..n, :ets.lookup(t, i) == [], into: [] do i end end def main do n = ii() primes = sieve(n) IO.puts length(primes) end end