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

}
