#include using namespace std; int main(){ long long N; short M; cin >> N >> M; cout << N / 1000 / M * 1000 << endl; return 0; }