open Batteries

let solve a b x = Enum.filter (fun i -> i mod x = 0) (a---b) |> Enum.count
let () =
  let [a; b; x] = read_line ()
                  |> String.nsplit ~by:" "
                  |> List.map int_of_string in
  solve a b x |> Printf.printf "%d\n"