l,k = map(int,input().split()) count = 0 while True: if l <= 2*k: print(count*k) break l = l-2*k count += 1