L,K=map(int,input().split()) l=0 cnt=0 while L>l: l+=K*2 cnt+=1 print(K*(cnt-1))