l, k = map(int, input().split()) c = -1 while l > 0: l -= k * 2 c += 1 print(k * c)