#include #include #include #include #include #include #include #include #include #include using namespace std; #define FOR(i,s,e) for (int i = int(s); i != int(e); i++) #define FORIT(i,c) for (typeof((c).begin()) i = (c).begin(); i != (c).end(); i++) #define ISEQ(c) (c).begin(), (c).end() int main(){ int L,K; cin >> L >> K; int kai = L/(2*K); if (L%(2*K) == 0) kai--; int ans = kai*K; cout << ans << endl; return 0; }