program main
  implicit none
  
  integer(16) :: a,b,x,aa,bb
  
  read(*,*)a,b,x
  if (a == b) then
    write(*,*)0
    stop
  end if
  aa = a/x
  bb = b/x
  if (mod(aa,x) == 0) then
    write(*,*)bb-aa+1
  else
    write(*,*)bb-aa
  end if
end program main
