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