#include<bits/stdc++.h>
using namespace std;

#define sz 1000006
#define ERROR 1e-9
#define PI acos(-1.0)
#define INF 10000007
#define LLINF 100000000000000007

#define F first
#define S second
#define pb push_back
#define mk make_pair
#define all(x) x.begin(),x.end()

typedef long long ll;

ll LCM(ll a,ll b) {return a*(b/__gcd(a,b));}

int main()
{

    ll a,b,x;
    cin>>a>>b>>x;

    ll ans = b/x - (a-1)/x;
    cout<<ans<<endl;

    return 0;
}
