a, b, x = list(map(int, input().split()))

c=a//x

d=b//x

e=a%x

if(e == 0):

    print((d-c+1))

else:

    print((d-c))
a,b,x=list(map(int, input().split()))

c=b//x-a//x

if(a%x==0):

    print((c+1))

else:

    print(c)
a, b, x = list(map(int, input().split()))
c = a // x
d = b // x
e = a % x
if e == 0:
    print((d - c + 1))
else:
    print((d - c))

a, b, x = list(map(int, input().split()))
c = b // x - a // x
if a % x == 0:
    print((c + 1))
else:
    print(c)

-c = a // x -d = b // x -e = a % x -if e == 0: -    print((d - c + 1)) +c = b // x - a // x +if a % x == 0: +    print((c + 1)) -    print((d - c)) +    print(c)