let () =
  let m = ref 0 in
  let l = ref [] in
  let rec read () =
    let n = read_int () in
    m := max !m n;
    l := n :: !l;
    read ()
  in
  try read() with _ -> begin
    incr m;
    let a = Array.make !m false in a.(0) <- true;
    let dp = Array.make !m 0 in
    let rec aux i j =
      if i*j < !m then (a.(i*j) <- true; aux i (j + 1))
    and make i =
      if i < !m then begin
        if not a.(i) then aux i 2;
        dp.(i) <- dp.(i - 1) + (if a.(i) then 0 else 1);
        make (i + 1)
      end
    in
    make 2;
    List.iter (fun n -> Printf.printf "%d\n" dp.(n)) (List.rev !l)
  end