L,K = map(int,input().split()) count=0 while 1: if L <= 2*K: break L = L-2*K count +=1 print(count * K)