Problem Description

You can do operations: n=n-1, if n%2==0 n=n/2, if n%3==0 n=n/3. Find minimum steps to make n to 1.

Input Format

One integer n.

Output Format

One integer min steps.

Sample Test Case

Input:
10
Output:
3

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next