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