l, k = map(int, input().split()) if l % (2*k) == 0: n = l // (2*k) - 1 else: n = l // (2*k) print(n*k)