#include using namespace std; typedef long long ll; int main() { ll L,R,C; cin>>L>>R>>C; ll cnt=0; ll m=INT_MAX; for(ll i=L;i<=R;i++) { cnt=(i*C)%1000; if(1000-cnt