Find the minimum number sum of digits of special number that sums to a number N
A special number is a number of the form {..., 111, 11 , 1 , -1, -11, 111, .....}
$$$1 \lt = N \lt = 10^{12}$$$
Example
Input 19
output 7
Explanation 11 + 11 + (-1) + (-1) + (-1)
2 + 2 + 1 + 1 + 1 = 7 digits







