#include using namespace std; int main() { int m,i; long n; cin>>n>>m; i=0; while(m*1000*i<=n)i++; cout<<(i-1)*1000<