(defn betweenAandB [[a b x]]
  (+ 
   (- (long (/ b x)) (long (/ a x)))
   (if (zero? (+ (mod b x) (mod a x))) 1 0)))

(defn create-data [s]
  (map #(Long/parseLong %) (.split s " ")))

(println (betweenAandB (create-data (read-line))))