Problem Description

Read n. Define function step(x) that returns x//2 if x even else 3*x+1. Starting from n, keep applying step until 1. Output number of 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