#include using namespace std; int main(){ int n,m; cin >> n >> m; int a = (n / 1000) / m; cout << a * 1000 << "\n"; return 0; }