#include<stdio.h>
int main()
{
    long long a,b,x,c=0,i;

    scanf("%lld%lld%lld",&a,&b,&x);
   if(a%x==0 || b%x==0)
   c=b/x-a/x+1;
   else
      c=b/x-a/x;
    printf("%lld\n",c);

    return 0;
}
