program ABC048B
    implicit none
    integer(8)::a,b,x,fa,fb
    read(5,*)a,b,x
    if(a==0)then
        fa=0
    else
        fa=(a-1)/x+1
    end if
    fb=b/x+1
    print'(i0)',fb-fa
end program ABC048B