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