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