1’s For All
문제
The complexity of an integer is the minimum number of 's needed to represent it using only addition, multiplication and parentheses. For example, the complexity of is (writing as ) and the complexity of is (writing as ). We'll modify this definition slightly to allow the concatenation operation as well. This operation (which we'll represent using ©) takes two integers and "glues" them together, so © becomes the four digit number . Using this operation, the complexity of is now (writing it either as © or ©). Note that the concatenation operation ignores any initial zeroes in the second operand: © does not result in but results in .
We'll give you guess what the object of this problem is.
입력
Each test case consists of a single line containing an integer , where .
출력
Output the complexity of the number, using the revised definition above.
예제
예제 1
2
2
예제 2
12
3