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