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