#include using namespace std; signed main() { int l, k; cin >> l >> k; int cnt = 1; while (l > 2 * k * cnt) cnt++; cout << k * (cnt - 1) << endl; }