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