#include int main(void) { long long int n; int m; int k=1000; scanf("%lld %d",&n,&m); while(k*m<=n){ k+=1000; } printf("%d\n",k-1000); return 0; }