#include<stdio.h>
int main()
{
    long long a,b,x,res;
    scanf("%llu %llu %llu",&a,&b,&x);
    if(a==b)
    {
        if(a%x==0)return res=1;
        else return res=0;
    }
    else
    {
        if(a%x==0||b%x==0)
            return res=((b-a)/x)+1;
        else
            return res=(b-a)/x;
    }
    printf("%llu\n",res);
    return 0;
}
