program main
  implicit none
  
  integer(16) :: a,b,x,aa,bb, c=0
  
  read(*,*)a,b,x
  if (a == b) then
    write(*,*)0
    stop
  end if
  do i = aa, bb
    if (mod(i,x) == 0) then
      c = c + 1
    end if
  end do
  write(*,'(i0)')c
end program main
