CodeLab Academy 📞 9936 6696
← List Python · Level 5: While loops Code · 50 points ← #402 #404 →

#403. Collatz steps

You get n. If n is even, it becomes n/2; if it is odd, it becomes 3n+1. How many steps until n becomes 1? ### Input One integer n (1 ≤ n ≤ 10000). ### Output The number of steps.

Examples

Input
9136
Output
34
Input
1093
Output
31

💡 You can solve it with Python, JavaScript or blocks. Read the input line by line with input(). Don't print a question (like input("Number: ")). Print exactly what the output asks for, nothing more.

🔒 You can solve the first 3 problems without an account. Sign up for free to solve this one!