#include using namespace std; int main() { int l, k; cin >> l >> k; int c = l / (2 * k); if (l % (2 * k) == 0) c--; int ans = k * c; cout << ans << endl; return 0; }