(defn input []
  (-> (read-line) Integer/parseInt))

(defn countd [n]
  (->> (range 1 (inc n))
    (filter #(zero? (rem n %)))
    count))

(defn b105 [N]
  (count
    (filter #(= 8 (countd %)) (range 105 (inc N) 2))))

(-> (input)
  b105
  println)