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