In an arithmetic expression, only the number , the operations of addition and multiplication, and parentheses are allowed. What is the minimum number of ones required to represent a given positive integer ?
One integer n~(1 \le n \le 5000).
Print the minimum number of ones used.
For example, the number can be represented as follows:
Example 1
Example 17