#include using namespace std; int main() { int i; int L; int K; cin >> L; cin >> K; i = L / ( 2 * K ); if( L % ( 2 * K ) == 0 ) i--; cout << i * K << endl; return 0; }