#include using namespace std; #define int long long signed main(){ int y,n;cin>>y>>n;y/=1000; cout<<(y/n)*1000<