#include using namespace std; int main() { int L, K; cin >> L >> K; int cnt = (L - 1) / (2 * K); cout << K * cnt << endl; }