let rec pow_mod x y m =
  if y = 0 then 1
  else let z = pow_mod (x*x mod m) (y / 2) m in if y mod 2 = 1 then x*z mod m else z

let prime_p n =
  if n == 2 then true
  else if n < 2 || n mod 2 = 0 then false
  else if pow_mod 2 (n - 1) n = 1 then true
  else false

let dp = Array.init 1000000 (fun i -> prime_p i)

let ans n =
  let rec doit i acc =
    if i > n then acc
    else doit (i + 1) (acc + (if dp.(i) then 1 else 0))
  in
  doit 2 0

let () =
  let rec f () =
    let n = read_int () in
    Printf.printf "%d\n" (ans n);
    f ()
  in
  try f() with _ -> ()