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