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