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