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