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