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