提示: 欢迎访问OurACM平台。
Problem 1320 Ones

Accept: 590    Submit: 2055
Time Limit: 1000 mSec    Memory Limit : 32768 KB

Problem Description

Given a positive integer N (0<=N<=10000), you are to find an expression equals to N using only 1,+,*,(,). 1 should not appear continuously, i.e. 11+1 is not allowed.

Input

There are multiple test cases. Each case contains only one line containing a integer N

Output

For each case, output the minimal number of 1s you need to get N.

Sample Input

2 10

Sample Output

2 7

Source

chenyan

Submit  Back  Status  Discuss