l, k = [int(i) for i in input().split()] if l / (k * 2) == 0: ans = 0 else: ans = int(l / (k * 2)) * k print(ans)