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