#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    ll a, b, x;
    cin >> a >> b >> x;
    if(a%x != 0) {
        ll tmp = x - (a%x);
        a += tmp;
    }
    if(b%x != 0){
        ll tmp = x - (b%x);
        b -= tmp;
    }
    ll ans = (b-a)/x + 1;
    cout << ans << "\n";
    return 0;
}
