L,K = map(int,input().split()) if L%(2*K): L -= L%(2*K) print(L//2) else: print(L//2-K)