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