#include <bits/stdc++.h>

using namespace std;
#define ul unsigned long long int

int main()
{
    ul a, b,x;

    scanf("%llu %llu %llu", &a, &b, &x);

    if(a-b==0){
        cout << "0"<<endl;
        return 0;
    }

    ul cnt1 = (a-1)/x;
    ul cnt2 = b/x;


        cout << cnt2 - cnt1<<endl;


    return 0;
}
