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