#include using namespace std; #define rep(i,n) for (int (i)=(0);(i)<(int)(n);++(i)) using ll = long long; using P = pair; using namespace std; int main() { int L, K; cin >> L >> K; cout << (L-1)/(2*K)*K << endl; }