
#include <bits/stdc++.h>

using namespace std;


int main(){

    long long a, b, x, cnt = 0;
    cin >> a >> b >> x;
    if(  a %  x == 0  or b % x == 0)
        cnt++;
    if(a >= x)
        cnt += (b - a)/x;
    else
        cnt+=b/x;
    cout << cnt << endl;
    return 0;
}
