L,K=map(int,input().split()) kaisuu=L//(2*K) nokori=L%(2*K) tabetaryou=K*kaisuu print(tabetaryou)