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