steps,width = (int(n) for n in input().split(' ')) rest = 0 ans = 0 while True: ans += (steps - 1 - rest) // width rest = (width - (steps % width) + rest) % width if rest == 0: break ans += 1 print(ans)