Decreasing Number#1560

Decreasing Number

1 second
128 megabytes
Very easy

You can perform the following operations on a positive integer:

Given a positive integer , find the minimum number of operations required to obtain from .

Input

Each line contains a single positive integer (1 \le n \le 10^6).

Output

For each , print the minimum number of operations required to obtain on a separate line.

Examples

Example 1

Loading
Loading