#include <iostream>
using namespace std;

int main() {

    long long a,b,x,count,f,g;

    cin >> a >> b >> x;




       f = a/x;
       g = b/x;

        count= g - f;

       if(a%x==0) count++;


cout << count << endl;
    return 0;
}


