Cakes#10251

Cakes

1 second
256 megabytes
Very easy

Vitaliy wants to buy exactly cakes. He has two purchasing options:

  1. Buy cake for coin.

  2. Buy k+1 cakes for coins.

Determine the minimum number of coins Vitaliy needs to spend to purchase exactly cakes.

Input

The input consists of a single line containing two integers and (1 \le n, k \le 10^{18}), where is the number of cakes to be purchased and is the number of coins required for the second type of purchase.

Output

Output a single integer representing the minimum number of coins needed to buy exactly cakes.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading

Note

In the first example, Vitaliy can buy 3 cakes for 2 coins and then buy 1 cake twice for 1 coin each. This results in a total of 2 + 1 + 1 = 4 coins.

In the second example, Vitaliy can simply buy 1 cake for 1 coin.

Scoring

Solutions that correctly handle the constraints 1 \le n, k \le 10^5 will earn 20% of the total points.