#include <iostream>
using namespace std;

int main() {

    long long a,b,x,i,count=0;
    cin >> a >> b >> x;

    for(i=a ; i <=b; i++)
    {   if(x!=0)
        {

        if(i%x == 0)
            count++;
        }
        else break;
    }
    cout << count;



    return 0;
}


