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