n, k = map(int, input().split()) if n <= k: print(1) else: ans = n // (k + 1) + (n % (k + 1)) // 2 + (n % (k + 1)) % 2 print(ans)