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

#427. Multiplicative persistence

You get n. How many times do you replace n by the product of its digits until it has one digit? ### Input One integer n (0 ≤ n ≤ 10¹⁸). ### Output The number of steps.

Examples

Input
39
Output
3
Input
277777788888899
Output
11

💡 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!