Problem Description

Read integer n (>0). Do: if n is even n=n/2 else n=3n+1. Count steps until n becomes 1. Output steps.

Input Format

One integer n.

Output Format

One integer steps.

Sample Test Case

Input:
6
Output:
8

Constraints

1

Solutions (0)

No solutions submitted yet. Be the first!

Discussion (0)

No comments yet. Start the discussion!

Prev Next