#include using namespace std; #define REP(i,n) for (int i = 0; i < n; i++) typedef long long ll; // Welcome to my source code! int main() { int l, k; cin >> l >> k; int cnt = 0, rem = l; REP(i, l/(k*2)) { if (rem - k*2 > 0) cnt++; } cout << cnt*k << endl; }