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