Problem:
 Score : 200 points    Problem Statement You are given nonnegative integers a and b ( a ≤ b ), and a positive integer x .
Among the integers between a and b , inclusive, how many are divisible by x ?      Constraints  0 ≤ a ≤ b ≤ 10^{18}  1 ≤ x ≤ 10^{18}         Input The input is given from Standard Input in the following format:  a  b  x       Output Print the number of the integers between a and b , inclusive, that are divisible by x .        Sample Input 1 4 8 2      Sample Output 1 3  There are three integers between 4 and 8 , inclusive, that are divisible by 2 : 4 , 6 and 8 .       Sample Input 2 0 5 1      Sample Output 2 6  There are six integers between 0 and 5 , inclusive, that are divisible by 1 : 0 , 1 , 2 , 3 , 4 and 5 .       Sample Input 3 9 9 2      Sample Output 3 0  There are no integer between 9 and 9 , inclusive, that is divisible by 2 .       Sample Input 4 1 1000000000000000000 3      Sample Output 4 333333333333333333  Watch out for integer overflows.

Solution (Python):
a, b, x = map(int, input().split())
ans_b = 1
ans_a = 1
ans_b += b // x
ans_a += a // x
if a % x == 0:
    print(ans_b-ans_a + 1)
else:
    print(ans_b-ans_a)

Solution (Python):
a, b, x = map(int, input().split())

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

Solution (Python):
from math import ceil,floor,comb,factorial,gcd,pow,sqrt,log2,cos,sin,tan,pi,inf
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from collections import deque,defaultdict,Counter
from bisect import bisect_left,bisect_right
from operator import itemgetter
from heapq import heappop,heappush
from copy import deepcopy
from time import time
import string
import sys
sys.setrecursionlimit(10 ** 7)
def input() : return sys.stdin.readline().strip()
def INT()   : return int(input())
def MAP()   : return map(int,input().split())
def LIST()  : return list(MAP())

a, b, x = MAP()
print(b//x-a//x+1 if a%x==0 else b//x-a//x)

Solution (Python):
a,b,c = map(int,input().split())
print(b // c - (a-1) // c)

Solution (Python):
import sys

readline = sys.stdin.readline
readlines = sys.stdin.readlines
ns = lambda: readline().rstrip() 
ni = lambda: int(readline().rstrip()) 
nm = lambda: map(int, readline().split()) 
nl = lambda: list(map(int, readline().split())) 

a, b, x = nm()
d_min = x - (a % x)
if d_min == x: 
    d_min = 0
d_max = b % x
min = a + d_min
max = b - d_max
if min > max: 
    ans = 0
else:
    ans = ((max - min) // x + 1)
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
print(b//x-(a-1)//x if a!=0 else b//x+1)

Solution (Python):
a,b,x = map(int,input().split())
if a%x!=0:
    ans = b//x - a//x
else:
    ans = b//x - a//x +1
print(ans)

Solution (Python):
a,b,x = map(int,input().split())
print(b//x-(a-1)//x)

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

Solution (Python):
(a, b, x) = map(int, input().split())

n_lt_a = a // x + 1
n_lt_b = b // x + 1

if a % x == 0:
    ans = n_lt_b - n_lt_a + 1
else:
    ans = n_lt_b - n_lt_a
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - a//x + (a%x == 0))

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

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

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

Solution (Python):
a,b,x=map(int,input().split())

if a==0:
    fl=-1
else:
    fl=(a-1)//x

cl=b//x

print(cl-fl)

Solution (Python):
a, b, x = map(int, input().split())
ans = int(b//x) - int(a//x)
if a%x ==0:
    ans += 1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
ans = int(b//x) - int(a//x)
if a%x ==0:
    ans += 1
print(ans)

Solution (Python):
if __name__ == "__main__":
    a, b, x = [int(x) for x in input().split(" ")]
    print(((b // x) + 1 - (((a - 1) // x) + 1)))

Solution (Python):
a, b, x = map(int,input().split())
nb = b//x
na_1 = (a-1)//x
print(nb-na_1)

Solution (Python):
def readinput():
    a,b,x=list(map(int,input().split()))
    return a,b,x
 
def main(a,b,x):
    ans = b//x - (a-1)//x
    return ans
 
if __name__=='__main__':
    a,b,x=readinput()
    ans=main(a,b,x)
    print(ans)

Solution (Python):
a,b,x = map(int,input().split())
a_num = 0
b_num = 0
if a == 0:
    b_num = (b//x)+1
else:
    a_num = ((a-1)//x)+1
    b_num = (b//x)+1
print(b_num-a_num)

Solution (Python):
def readinput():
    a,b,x=list(map(int,input().split()))
    return a,b,x

def main(a,b,x):
    ans = b//x - (a-1)//x
    return ans

if __name__=='__main__':
    a,b,x=readinput()
    ans=main(a,b,x)
    print(ans)

Solution (Python):
a,b,x=map(int, input().split())
max=b//x
min=(a+x-1)//x
print(max-min+1)

Solution (Python):
a,b,x = map(int,input().split())

B = b//x
A = (a-1)//x

print(B-A)

Solution (Python):
import sys
import numpy as np
import random
from decimal import Decimal
import itertools
import re
import bisect
from collections import deque, Counter
from functools import lru_cache

sys.setrecursionlimit(10**9)
INF = 10**13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
def SERIES(n): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ')
def GRID(h,w): return np.fromstring(sys.stdin.buffer.read(), dtype=np.int32, sep=' ').reshape(h,-1)[:,:w]
def GRIDfromString(h,w): return np.frombuffer(sys.stdin.buffer.read(), 'S1').reshape(h,-1)[:,:w]
MOD = 1000000007

def main():
	a, b, x = LI()
	if a%x == 0:
		y = 1
	else:
		y = 0
	print(b//x - a//x + y)

if __name__ == '__main__':
    main()

Solution (Python):
a,b,x = map(int, input().split())

ans = b // x - (a - 1) // x;
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)

Solution (Python):
a,b,x=map(int,input().split())
if x==1:
  print(b-a+1)
else:
  print(b//x-(a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

if a == 0:
    res = b // x + 1
else:
    res = (b // x) - ((a-1) // x)

print(res)

Solution (Python):


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

max = b // x
min = (a - 1) // x

print(max - min)

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

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

Solution (Python):

import sys


def solve(a: int, b: int, x: int):
    ans = b // x
    if a > 0:
        ans -= (a - 1) // x
    else:
        ans += 1
    print(ans)
    return



def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    a = int(next(tokens))  
    b = int(next(tokens))  
    x = int(next(tokens))  
    solve(a, b, x)

if __name__ == '__main__':
    main()

Solution (Python):
a, b, x = map(int, input().split())
print((b//x) + (-a//x) + 1)

Solution (Python):
a,b,x=map(int,input().split())

print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)

Solution (Python):
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

a, b, x = MAP()

print(b//x-(a-1)//x)

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x if a > 0 else -1
bcnt = b // x if b != 0 else 1
ans = bcnt - acnt if not(a == b == 0) else 1
print(ans)

Solution (Python):
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))


a, b, x = LI()
acnt = (a - 1) // x
bcnt = b // x
ans = bcnt - acnt
print(ans)

Solution (Python):
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Solution (Python):
a,b,x = map(int,input().split())

up = b//x*x
if a%x == 0:
    down = a
else:
    down = (a//x+1)*x
ans = (up-down)//x+1
print(ans)

Solution (Python):
a,b,x = map(int,input().split())
print(b//x-(a-1)//x)

Solution (Python):
a,b,x = map(int, input().split())
if a%x != 0: a += (x-a%x)
if b%x != 0: b -= b%x
ans = b//x - a//x +1 if a <= b else 0
print(ans)

Solution (Python):
from decimal import * 
a, b, x = map(str, input().split())
a = Decimal(a)
b = Decimal(b)
x = Decimal(x)

ans = int(b / x) - int(a / x)

if a % x == 0:
  ans += 1

print(int(ans))

Solution (Python):
a,b,x=map(int,input().split())
print(b//x-(a-1)//x)

Solution (Python):
a,b,x = list(map(int, input().split()))
print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

c = a//x
d = b//x

if a%x == 0:
  print(d-c+1)
else:
  print(d-c)

Solution (Python):


def read_int():
    return int(input().strip())


def read_ints():
    return list(map(int, input().strip().split(' ')))


def solve():
    a, b, x = read_ints()
    return b//x-(a-1)//x


if __name__ == '__main__':
    print(solve())

Solution (Python):
a, b, x = map(int, input().split())
if a == 1:
    print(b // x)
else:
    print(b // x - (a - 1) // x)

Solution (Python):
import sys
input = sys.stdin.readline




'''
a=[]
b=[]
for i in range():
    A, B = map(int, input().split())
    a.append(A)
    b.append(B)'''

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

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

Solution (Python):
a, b, x = map(int, input().split())
if a % x == 0:
  alpha = a // x
else:
  alpha = a // x + 1
beta = b // x
print(beta - alpha + 1)

Solution (Python):
a,b,x = map(int,input().split())

B = b // x
A = (a - 1) // x

ans = B - A
print(ans)

Solution (Python):
a, b, x = map(int, input().split())


def f(n):
    if n < 0:
        return 0
    else:
        a = n // x + 1
        return a


ans = f(b) - f(a - 1)
print(ans)

Solution (Python):
a,b,x=map(int,input().split())
ax=(a-1)//x
bx=b//x
print(bx-ax)

Solution (Python):
a,b,x = map(int, input().split())

s = (a-1)//x
if a == 0: s = -1
p = b//x

print(p - s)

Solution (Python):
a,b,x = map(int,input().split())
ad = (a-1)//x
bd = b//x
print(bd-ad)

Solution (Python):
a,b,x=map(int,input().split())
l=(b-a+1)//x
w=(b-a+1)%x
if w==0:
    print(l)
else:
    p=0
    if a%x==0 or a%x+w>=x+1:
        p=1
    print(l+p)

Solution (Python):
a, b, x = map(int,input().split())

A = (a-1)//x
B = b//x

print(B - A)

Solution (Python):
a, b, x = map(int, input().split())

print(b//x - (a-1)//x)

Solution (Python):
a,b,x=map(int,input().split())
A=a//x
B=b//x
ans=B-A
if a%x==0:
    ans+=1
print(ans)

Solution (Python):
a,b,x=map(int,input().split())
if a>2:
  s=b//x
  t=(a-1)//x
  print(s-t)
elif a==1:
  print(b//x)
elif a==0:
  print(b//x+1)

Solution (Python):


LI = lambda: list(map(int, input().split()))


a, b, x = LI()


def main():
    if a % x == 0:
        v = a
    else:
        v = (a // x + 1) * x
    if v > b:
        ans = 0
    else:
        ans = (b - v) // x + 1
    print(ans)


if __name__ == "__main__":
    main()

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

print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

print(b // x - (a - 1) // x)

Solution (Python):
a,b,x=map(int,input().split());print((b//x)-((a-1)//x))

Solution (Python):
a, b, x = map(int, input().split())

if a%x == 0:
    print(b//x - a//x + 1)
else:
    print(b//x - a//x)

Solution (Python):
def resolve():
    a, b, x = [int(i) for i in input().split()]
    print((b // x) - ((a - 1) // x))


resolve()

Solution (Python):
a,b,x=map(int,input().split())

if a==0:
    print(b//x+1)
else:
    print(b//x-(a-1)//x)

Solution (Python):
a,b,x = map(int,input().split())
print(b//x -(a-1)//x)

Solution (Python):
def cnt(n, x):
    if n < 0:
        return 0
    return n // x + 1

a, b, x = map(int, input().split())
print(cnt(b, x) - cnt(a - 1, x))

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

Solution (Python):



import os
import sys







def main():
    a, b, x = map(int, input().split())

    print((b // x) - ((a - 1) // x))
    return


if __name__ == '__main__':
    main()

Solution (Python):
a,b,x = map(int,input().split())

def f(n):
    if n== -1:
        return 0
    else:
        return n//x + 1
print(f(b)-f(a-1))

Solution (Python):
a, b, x = map(int, input().split())


def f(n):
    if n == -1:
        return 0
    else:
        return n // x + 1


print(f(b) - f(a - 1))

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)

Solution (Python):
A, B, X = map(int, input().split())

def calc(N, X):
    if N < 0:
        return 0
    return N // X + 1

P = calc(A-1, X)
Q = calc(B, X)

print(Q-P)

Solution (Python):
A, B, X = map(int, input().split())

P, r = divmod(A, X)
if r:
    P += 1

Q, r = divmod(B, X)


print(max(0, Q-P+1))

Solution (Python):
a,b,x = map(int,input().split())
if a%x!=0:
    temp = a%x
    a += x-temp
if a>b:
    print(0)
elif a==b:
    print(1)
else:
    temp = (b-a)//x
    print(temp+1)

Solution (Python):
a,b,x = map(int,input().split())
ans = b//x - max(0,(a-1))//x
if a == 0:
    ans += 1
print(ans)

Solution (Python):
from decimal import *
import math




s = input().split()
t = [int(p) for p in s]


a = t[0]
b = t[1]
x = t[2]
if(a != 0):
    print(b // x - (a-1) // x)
else:
    print(b // x + 1)
'''
n = math.floor(Decimal(b-a+1) / Decimal(x))

p = (b-a+1) % x
if(p > 0):
    l = a % x
    if(l <= p-1):
        n += 1
print(n)
'''

'''
start = a
goal = b
while True:
    if(start % x == 0):
        break
    else:
        start += 1

while True:
    if(goal % x == 0):
        break
    else:
        goal -= 1




print(Decimal(Decimal(Decimal(goal) - Decimal(start)) / Decimal(x)) + Decimal(1)  ) 


'''
'''

def count_even(t, x):
    return int( Decimal(t)/ Decimal(x) )

if( a == 0):
    answer = count_even(b, x) + 1
else:
    answer = count_even(b, x) - count_even(a-1, x)
print(answer)
'''

Solution (Python):






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





if a%x == 0:
    print(b//x - a//x + 1)
else:
    print(b//x - a//x)

Solution (Python):
a, b, x = map(int, input().split())
x_min = (a - 1) // x
x_max = b // x
if x_max >= x_min:
    print(x_max - x_min)

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

aa = (a-1) // x + 1

bb = b // x

print(bb - aa + 1)

Solution (Python):
a, b, x = map(int, input().split())

if a%x != 0:
    aa = a + (x - a % x)
else: aa = a

ans = (b - aa) // x + 1

print(ans)

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

Solution (Python):
a,b,x=map(int,input().split())
temp1=(b//x)+1
if 0<=a-1:
  temp2=((a-1)//x)+1
else:
  temp2=0
print(temp1-temp2)

Solution (Python):
a,b,x = map(int,input().split())
print((b//x+1)-((a-1)//x+1))

Solution (Python):
nums = [int(e) for e in input().split()]
def f(n, x):
    if n >=0:
        return int(n//x)+1
    elif n==-1:
        return 0

print(f(nums[1], nums[2])-f(nums[0]-1, nums[2]))

Solution (Python):
import numpy as np
import math
import sys
def sinput(): return sys.stdin.readline()
def iinput(): return int(sinput())
def imap(): return map(int, sinput().split())
def fmap(): return map(float, sinput().split())
def iarr(): return list(imap())
def farr(): return list(fmap())
def sarr(): return sinput().split()

a, b, x = imap()
ans = (b//x) - (a//x)
if a % x == 0: ans += 1
print(ans)

Solution (Python):
import math as m
from decimal import *
a,b,x = map(int,input().split())
tot = b-a+1
rem = a%x
getcontext().prec = 100
if rem > 0:
  tot-=x-rem
print(m.ceil(Decimal(tot)/Decimal(x)))

Solution (Python):
a, b, x = map(int, input().split())
ans = (b-a + (a%x)) // x
if a % x == 0:
    ans += 1
print(ans)

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

Solution (Python):
import sys
from functools import lru_cache, cmp_to_key
from heapq import merge, heapify, heappop, heappush
from math import *
from collections import defaultdict as dd, deque, Counter as C
from itertools import combinations as comb, permutations as perm
from bisect import bisect_left as bl, bisect_right as br, bisect
from time import perf_counter
from fractions import Fraction
sys.setrecursionlimit(int(pow(10,6)))


mod = int(pow(10, 9) + 7)
mod2 = 998244353
def data(): return sys.stdin.readline().strip()
def out(*var, end="\n"): sys.stdout.write(' '.join(map(str, var))+end)
def l(): return list(sp())
def sl(): return list(ssp())
def sp(): return map(int, data().split())
def ssp(): return map(str, data().split())
def l1d(n, val=0): return [val for i in range(n)]
def l2d(n, m, val=0): return [l1d(n, val) for j in range(m)]


a,b,x=l()
b=b//x
a=a//x-(a%x==0)
print(b-a)

Solution (Python):
a,b,x=map(int,input().split())
if a%x>0 and b%x>0:
    print(b//x-a//x)
elif b%x==0 and a%x>0:
    print(b//x-a//x)
else:
    print(b//x-a//x+1)

Solution (Python):
a, b, x = map(int, input().split())
c = b // x + 1
d = 0
if a - 1 > -1:
  d = (a - 1) // x + 1
else:
  d = 0
print(c - d)

Solution (Python):


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

_a = a//x
m_a = a%x
_b = b//x

if m_a == 0:
    print(_b - _a + 1)
else:
    print(_b - _a)

Solution (Python):
def main():
    a, b, x = map(int, input().split())
    ans = b // x - a // x
    if a % x == 0:
        ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
readline = sys.stdin.readline

a,b,x = map(int,readline().split())

print((b // x) - (a - 1)// x)

Solution (Python):

def ans() : 
  a, b, x = tuple(map(int, input().split()))
  c1 = b // x
  c2 = (a - 1) // x
  print(c1 - c2)
  
  
ans()

Solution (Python):
def solve():
    a, b, x = map(int, input().split())
    
    if a != 0:
        return b//x - (a-1)//x
    else:
        return b//x + 1

print(solve())

Solution (Python):
a,b,x=map(int,input().split())
print(b//x-(a-1)//x if a else b//x+1)

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

Solution (Python):
a,b,x=map(int,input().split())

def f_mod(a,x):
  return a//x+1

print(f_mod(b,x)-f_mod(a-1,x))

Solution (Python):

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

if a == 0:
    print(b//x + 1)
else:
    print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split()) 
print( b//x - (a-1)//x )

Solution (Python):
import sys


import math
import collections

import bisect
import itertools
import fractions

import copy
import heapq
import decimal

import queue
import numpy as np

sys.setrecursionlimit(10000001)
INF = 10 ** 16
MOD = 10 ** 9 + 7

ni = lambda: int(sys.stdin.readline())
ns = lambda: map(int, sys.stdin.readline().split())
na = lambda: list(map(int, sys.stdin.readline().split()))





def main():
    a, b, x = ns()
    tmp = 0
    if a % x == 0:
        tmp = 1
    ans = b // x - a // x + tmp
    if x == 0:
        ans += 1
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):


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

A = a // x
B = b // x
if a % x != 0:
  print(B-A)
else:
  print( B-A + 1)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x)

Solution (Python):
a, b, x = map(int, input().split())
a -= 1  
cnt = b//x - a//x
print(cnt)

Solution (Python):



a, b, x = list(map(int, input().split()))
print(b//x - (a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

B = b//x
A = (a-1)//x
print(B-A)

Solution (Python):
import sys
def main():
    a,b,x=tuple(map(int,sys.stdin.readline().split()))
    res=b//x-a//x if a%x!=0 else b//x-a//x+1
    print(res)
if __name__=='__main__':main()

Solution (Python):
"""
N = list(map(int,input().split()))
S = [str(input()) for _ in range(N)]
S = [list(map(int,list(input()))) for _ in range(h)] 
print(*S,sep="")
"""

import sys
sys.setrecursionlimit(10**6)
input = lambda: sys.stdin.readline().rstrip()
inf = float("inf") 

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

first = x*(a//x + bool(a%x))
end = x*(b//x)
if first==end:
    print(1)
elif first>end:
    print(0)
else:
    print((end-first)//x+1)

Solution (Python):

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


def func(num1, num2, divide_num):
    ans = num2 // divide_num - (num1 - 1) // divide_num

    print(ans)


func(num1=a, num2=b, divide_num=x)

Solution (Python):

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


def func(num1, num2, divide_num):
    ans = num2 // divide_num - (num1 - 1) // divide_num
    
    

    print(ans)


func(num1=a, num2=b, divide_num=x)

Solution (Python):
a,b,x = map(int,input().split())
print((b//x) - ((a-1)//x))

Solution (Python):
a,b,x=map(int,input().split())

if a%x==0:
  a-=x
elif b%x==0:
  b+=x
elif b%x<a%x:
  b+=x
count=(b-a)//x
if count<0:
  count=0
print(count)

Solution (Python):
a, b, x = map(int, input().split())
fb = b//x + 1
if a == 0:
    fam = 0
else:
    fam = (a-1)//x + 1
print(fb-fam)

Solution (Python):
a, b, x = map(int, input().split())
an = a%x
if an != 0:
    an = x - an
if a + an > b:
    ans = 0
else:
    ans = (b-a-an)//x + 1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())

b_ = b // x

a_ = (a-1) // x

print(b_ - a_)

Solution (Python):
x, y, z=map(int, input().split())
ans=y//z-x//z
if x%z==0:
  ans+=1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
ans = b//x - a//x
if a % x == 0:
    ans += 1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())


bx = b//x + 1
ax = (a-1)//x + 1
ans = bx - ax
print(ans)

Solution (Python):
a,b,x=map(int,input().split())
num1=-(a//-x)
num2=b//x
print(num2-num1+1)

Solution (Python):
a,b,x=map(int,input().split())
ta=(a-1)//x
tb=b//x
ans=tb-ta
print(ans)

Solution (Python):
a, b, x =map(int, input().split())
print((b // x) - ((a - 1) // x))

Solution (Python):

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

Solution (Python):
a,b,x = map(int,input().split())
ans = b//x - a//x
if a % x == 0:
    ans += 1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())

ans = b // x - a // x
if a % x == 0:
    ans += 1
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
l = (a - 1) // x
r = b // x
print(r - l)

Solution (Python):
a, b,c = map(int, input().split())
one = a//c
two = b//c
if c==1 or a%c==0:
  two+=1
print(two-one)

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

Solution (Python):
a,b,x=map(int,input().split())
print(b//x-(a-1)//x if a>0 else b//x+1)

Solution (Python):
A, B, X = map(int, input().split())
bx = B // X
ax = A // X

if A % X == 0:
    print(bx - ax + 1)
else:
    print(bx - ax)

Solution (Python):

"""
Created on Sat May 30 16:32:18 2020

@author: NEC-PCuser
"""

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

a_shou = a // x
b_shou = b // x

ans = b_shou - a_shou

if (a % x == 0):
    ans += 1

print(int(ans))

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

Solution (Python):
def main():
    A, B, X = map(int, input().split())
    ans = B // X - (A - 1) // X
    print(ans)


if __name__ == '__main__':
    main()

Solution (Python):
a, b, x = map(int, input().split())

a = -(-a // x) * x
b = (b // x) * x
print(max(0, (b - a) // x + 1))

Solution (Python):
a, b, x = map(int,input().split())

if(a%x == 0):
    A = a//x
else:
    A = a//x + 1

B = b//x
print(B-A+1)

Solution (Python):
a,b,x = map(int,input().split())

print(b//x - (a-1)//x)

Solution (Python):

"""
Created on Sat May 30 12:02:39 2020

@author: naoki
"""

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

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

Solution (Python):
a, b, x = map(int, input().split())
b //= x
a = (a - 1) // x
print(b - a)

Solution (Python):
"""解説から
1. n以下の整数からxで割り切れる数の数を求めるにはn//xすると良い f(n)
2. b以下の整数からxで割り切れる数の数を求める f(b)
3. a"未満"の整数は除外する必要があるのでf(a-1)を求める
4. f(b)-f(a-1)がa以上b以下の整数からxで割り切れる数の個数となる
5. a==0の時、f(a-1) == -1 となる。f(b) - -1 == f(b) + 1となるので、
    0以上b以下の数のxを求めるときにもきちんと求めることができる
"""
a, b, x = map(int, input().split())
b //= x
a = (a - 1) // x
print(b - a)

Solution (Python):
N = list(map(int, input().split()))
a = N[0]
b = N[1]
x = N[2]
if a % x == 0:
    a_min = a // x - 1
else:
    a_min = a // x
b_max = b // x
print(b_max - a_min)

Solution (Python):
a,b,x=map(int,input().split())
print(b//x-a//x+(a%x==0))

Solution (Python):
a,b,x=map(int,input().split())

if a%x==0:
  print(b//x-a//x+1)
else:
  print(b//x-a//x)

Solution (Python):
a,b,x=map(int, input().split())

MIN=a+(x-a%x)%x

if MIN>b:
    print(0)
else:
    print(1+(b-MIN)//x)

Solution (Python):
a,b,x=map(int,input().split())





b1=b//x
if a%x==0:
  b1+=1
a1=a//x

print(b1-a1)

Solution (Python):
import sys
from collections import Counter
from collections import deque
import math
import fractions
def input(): return sys.stdin.readline().strip()
def mp(): return map(int,input().split())
def lmp(): return list(map(int,input().split()))

a,b,x=mp()
print(b//x-(a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())
na=(a-1)//x
nb=b//x
print(nb-na)

Solution (Python):
a, b, x = map(int, input().split())

print(b // x + 1 - ((a - 1) // x + 1))

Solution (Python):
a, b, x = map(int, input().split())
print(b//x-(a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())
A = (a-1)//x
B = b//x
ans = B-A

print(ans)

Solution (Python):
A, B, X = map(int, input().split())

def f(N):
    return N // X

print(f(B) - f(A - 1))

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b,x=map(int, input().split())
    amade=(a-1)//x
    bmade=b//x
    print(bmade-amade)
resolve()

Solution (Python):
a,b,x = map(int,input().split())
print(b//x-(a-1)//x)

Solution (Python):
from sys import stdin
def main():
    
    readline=stdin.readline
    a,b,x=map(int,readline().split())

    if a==0:
        print(b//x+1)
    else:
        print(b//x-(a-1)//x)

if __name__=="__main__":
    main()

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()

def resolve():
    a,b,x=map(int, input().split())
    if a!=0:
        amade=(a-1)//x
        bmade=b//x
        print(bmade-amade)
    else:
        print(b//x+1)
resolve()

Solution (Python):
a,b,x = map(int,input().split())
a -= 1

ans = b//x - a//x

print(ans)

Solution (Python):
import sys

sys.setrecursionlimit(10 ** 7)
input = sys.stdin.readline
f_inf = float('inf')
mod = 10 ** 9 + 7


def resolve():
    a, b, x = map(int, input().split())

    res_a = (a - 1) // x
    res_b = b // x
    print(res_b - res_a)


if __name__ == '__main__':
    resolve()

Solution (Python):
a,b,x=map(int,input().split())

ap=a//x
bp=b//x

ans=bp-ap
if a%x==0:
  ans+=1

print(ans)

Solution (Python):
a,b,x = map(int, input().split())

print(b//x-(a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())
print(b//x-(a-1)//x)

Solution (Python):
a,b,x = map(int, input().split())

if a != 0:
  print(b//x-(a-1)//x)
else:
  print(b//x+1)

Solution (Python):
a,b,x = map(int,input().split())
ans = b // x
a-=1
ans -= (a // x)
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a - 1) // x if a > 0 else b // x + 1)

Solution (Python):
a, b, x = map(int, input().split())

ans = b // x - (a - 1) // x
print(ans)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a -1) // x)

Solution (Python):
a, b, x = map(int, input().split())

i = a// x
j = b// x
p = i* x
q = j* x
while i* x < a:
  i+= 1
  p = i* x
while j* x < b:
  j+= 1
  q = (j- 1)* x

ans = int((q- p)// x)+ 1

if(ans<= 0):
  print(0)
else:
  print(ans)

Solution (Python):
a,b,x = map(int, input().split())

ans = b//x - a//x + (a%x==0)
print(max(0,ans))

Solution (Python):
a, b, x = map(int, input().split())

ans = b // x - a // x
if a % x == 0:
    ans += 1
print(ans)

Solution (Python):
a, b, x = [int(_) for _ in input().split()]

count = b//x - a//x

if a%x == 0:
    count += 1

print(count)

Solution (Python):
import sys


numbers = sys.stdin.readline().split(' ')

a = int(numbers[0])
b = int(numbers[1])
c = int(numbers[2])


if a > 0:
    print(b//c - (a-1)//c)
else:
    print(b//c+1)

Solution (Python):
import sys
sys.setrecursionlimit(10 ** 6)

def int1(x): return int(x) - 1
def II(): return int(input())

def MI(): return map(int, input().split())
def MI1(): return map(int1, input().split())

def LI(): return list(map(int, input().split()))
def LI1(): return list(map(int1, input().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]

def SI(): return input().split()

def printlist(lst, k='\n'): print(k.join(list(map(str, lst))))
INF = float('inf')

from math import ceil, floor, log2
from collections import deque
from itertools import combinations as comb, combinations_with_replacement as comb_w, accumulate, product


def solve():
    a, b, x = MI()

    def f(n, x):
        return n // x

    print(f(b, x) - f(a-1, x))


if __name__ == '__main__':
    solve()

Solution (Python):
a,b,x = map(int, input().split())
b = b // x+1
if a != 0:
    a = (a-1) // x+1

print(b - a)

Solution (Python):
a,b,x = map(int, input().split())
right = b // x + 1
if a == 0:
  left = 0
else:
  left = (a - 1) // x + 1
print(right - left)

Solution (Python):
a,b,x = map(int, input().split())
print(b//x - (a-1)//x)

Solution (Python):
start, end, div = list(map(int, input().strip().split()))

count = end // div - start //div

if start % div == 0:
  count += 1
print(count)

Solution (Python):
a, b, x = map(int, input().split())

if a == 0:
  print(b//x + 1)
else:
  print(b//x - (a-1)//x)

Solution (Python):
a,b,x = map(int,input().split())
print(b//x-(a-1)//x)

Solution (Python):
a, b, x = map(int, input().split())

bans = b//x
aans = a//x

if a%x == 0:
    aans -= 1

print(bans - aans)

Solution (Python):
a, b, x = map(int, input().split())
print(b//x - (a-1)//x)

Solution (Python):
a,b,x = map(int, input().split())


cnt=0

alfa = b//x + 1
beta = (a-1)//x + 1

print(alfa - beta)

Solution (Python):
a,b,x = map(int,input().split())
alpha = 0
beta = 0
if a-1 == -1:
  alpha = 0
else:
  alpha = ((a-1)//x)+1
beta = (b//x)+1
print(beta-alpha)

Solution (Python):
a, b, x = map(int, input().split())


def f(n):
    return n//x


print(f(b)-f(a-1))

Solution (Python):
a,b,x = map(int, input().split())
print(b//x-(a-1)//x)

Solution (Python):
a,b,x=map(int,input().split())

a_ans=(a-1)//x
b_ans=b//x
print(b_ans-a_ans)

Solution (Python):
a, b, x = map(int, input().split())

num_b = b // x
num_a = a // x
res = num_b - num_a
if a % x == 0:
    res += 1
print(res)

Solution (Python):
a, b, x = map(int, input().split())
print(b // x - (a -1) // x)