#include //cin, cout #include //vector #include //sort,min,max #include //string #include //fixed #include //setprecision #include //swap #include //abs(int) using namespace std; int main() { int L, K; cin >> L >> K; int a = L / (K * 2); int b = L % (K * 2); int ans = 0; if (b != 0) { ans = a * K; } else { ans = (a - 1) * K; } cout << ans << endl; return 0; }