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