let () = Scanf.scanf "%d" (fun n ->
      let number_of_divisor n = 
      let rec number_of_divisor' m number =
      match m with
      | 0   -> number
      | m'  -> 
      (let rec is_m'_divisor n' = 
      begin match n' with
      |  0 -> number_of_divisor' (m-1) number
      | n' when m' * n' = n -> number_of_divisor' (m-1) (number + 1)
      | _ -> is_m'_divisor (n' - 1)
      end
      in is_m'_divisor n)
      in number_of_divisor' n 0
      in
      let rec number_of_eight_divisor_to_n n output =
      if n = 0
      then output 
      else if n mod 2 = 0 
      then number_of_eight_divisor_to_n (n - 1) output
      else if number_of_divisor n = 8 
      then number_of_eight_divisor_to_n (n - 1) (output + 1)
      else number_of_eight_divisor_to_n (n - 1) output
      in
 	  Printf.printf "%d" (number_of_eight_divisor_to_n n 0))