J. Thanos Power
time limit per test
1 second
memory limit per test
256 megabytes
input
standard input
output
standard output

After gathering all the infinity stones and dusting half the population of the universe, Thanos went to gardens street. He decided to plant some flowers using the reality stone.

So Thanos now wants to plant $$$N$$$ flowers in least number of steps needed. In each step he can: Choose a number $$$(0 \leq x)$$$,then Plant $$$10^x$$$ plants or remove $$$10^x$$$ plants with the help of the power stone. What is the least number of steps he needs to plant exactly $$$N$$$ flowers.

Input

A single integer $$$N$$$ $$$(0 \le N \le 10^{10^5})$$$, the number of flowers Thanos wants to plant.

Output

The least number of steps Thanos needs to plant $$$N$$$ plants.

Examples
Input
3000
Output
3
Input
231
Output
6
Note

In the first sample, fastest way to plant 3000 plants is:

step 1 plant $$$10^3$$$

step 2 plant $$$10^3$$$

step 3 plant $$$10^3$$$

so the answer is 3 steps.