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