l, k = map(int, input().split()) q, mod = divmod(l, 2*k) if mod == 0: print((l - 2*k) / 2) else: print(k*q)