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