#include <bits/stdc++.h>
using namespace std;
int main() {
    unsigned long long a, b, x;
    cin >> a >> b >> x;
    if (a!=0) cout << b/x - (a-1)/x << endl;
    if (a==0) cout << b/x + 1 << endl;
    return 0;
}