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