h, a = map(int, input().split()) h //= a ans = 1 cnt = 1 while h: h //= a cnt *= 2 ans += cnt print(ans)