Barrel#7375

Barrel

1 second
64 megabytes
Easy

Using two containers with capacities of liters and liters, you must collect liters of water in a -liter barrel so that the total number of pour operations into and out of the barrel is minimized.

For example, to obtain liters of water, you can pour liters into the barrel twice, and then pour out liters once. In total, three pour operations are performed.

Input

One non-negative integer m~(0 \le m \le 100).

Output

Print the minimum number of pour operations.

Examples

Example 1

Loading
Loading