#include using namespace std; int main(){ int N, M; int o = 0; cin >> N; cin >> M; for(;;){ if(1000 * M <= N){ o += 1000; N -= 1000 * M; }else { break; } } cout << o << endl; return 0; }