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