C. Invasive Pumpkins
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

A haunted pumpkin has landed in Alice's backyard, just in time for Halloween! It has the spooky property of spreading: Every night, the amount of pumpkins in Alice's backyard will double, until she casts a spell to end the process. Alice doesn't want to disenchant the pumpkin yet, she would like to have exactly $$$n$$$ pumpkins in her backyard first. She can also do some work in her yard to remove pumpkins, removing up to $$$k$$$ pumpkins every day.

Thus, every day, Alice may choose to do one of the following:

  1. Cast a spell to permanently stop the pumpkins from doubling (this can only happen exactly once)
  2. Remove up to $$$k$$$ pumpkins (if possible). Note that after this removal, the pumpkins will still double if the spell hasn't been used (refer to sample test 2's explanation)

Find the minimum amount of days for Alice to reach her goal of her garden ending up with $$$n$$$ pumpkins! Note that she must always cast the spell to stop the doubling exactly once.

Input

The integers $$$n$$$ ($$$1 \leq n \leq 1000$$$) and $$$k$$$ $$$(1 \leq k \leq 1000)$$$, the number of pumpkins Alice wants, and the amount she can remove every day. There is initially 1 pumpkin.

Output

Output a single integer, the minimum number of days for Alice to reach $$$n$$$ pumpkins.

Examples
Input
7 1
Output
5
Input
10 2
Output
5
Input
1 1000
Output
1
Note

In the first case, the optimal answer is 5. Alice should let the pumpkins double for 3 days, getting to 8 pumpkins. On day 4, she should cast the spell to stop the doubling, remaining at 8 pumpkins. On day 5, she should remove 1 pumpkin.

In the second case, the optimal answer is 5. Alice should let the pumpkins double for 2 days, getting to 4 pumpkins. On day 3, she should remove a pumpkin, going down to 3, which then doubles to 6. On day 4, she should remove a pumpkin, going down to 5, which then doubles to 10. On day 5, she should cast the spell to stop the doubling.

In the third case, the optimal answer is 1. Alice has 1 pumpkin, and should cast the spell to stop the doubling.