let rec div n i lst =
  if i = 1 then (List.length lst) + 1
  else if n mod i = 0 then div n (i-1) (i :: lst)
  else div n (i-1) lst
let rec f n ans =
  if n = 1 then ans
  else if (div n n []) = 8 then f (n-2) (ans+1)
  else f (n-2) ans
let () =
  Scanf.scanf "%d\n"
    (fun n -> if n mod 2 = 0 then f (n-1) 0 else f n 0) 
  |> print_int