#include using namespace std; int main() { int L, K; cin >> L >> K; int sub = K; while(L > sub * 2) { /*if (L / 2 <= sub) { cout << sub - K << endl; break; }*/ sub += K; } cout << sub - K << endl; return 0; }