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