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