l, k = map(int, input().split())

if l % 2 == 0:
    count = (l - 1) // (2 * k)
else:
    count =  l // (2 * k)

print(count * k)