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