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

int main()
{
    unsigned long long int a,b,c,d,e;
    cin>>a>>b>>c;
    for (unsigned long long int i=a;;i++)
    {
    	if(i%c==0)
    	{
    		d=i/c;
    		break;
    	}
    }
    for (unsigned long long int i=b;;i--)
    {
    	if(i%c==0)
    	{
    		e=i/c;
    		break;
    	}
    }
    if(e-d>0)
    {
    	cout<<e-d<<endl;
    }
    else if(e==d)
    {
    	cout<<"1"<<endl;
    }
    else
    cout<<"0"<<endl;
    return 0;
}