Weighing balance#7110

Weighing balance

1 second
128 megabytes
Very easy (≈850)
prb7110

Measurement of the weight of an object is carried out using laboratory scales. Using a set of weights weighing g, g, g, g, g, g and g, you can measure the weight of any item with a whole weight from to g in a single way. For example, to measure an object weighing g, you need to put weights of and g on one bowl, and on the other the object itself. For an object weighing g add to the cup with it the weights of , and g, and on another cup - put the weight of g.

Determine how many weights from this set should be used to weigh an item of a given weight.

Input

One positive integer (1 \le x \le 1000) - the weight of the item.

Output

Print the number of weights needed to weigh the item.

Examples

Example 1

Loading
Loading

Example 2

Loading
Loading