Kipa likes multiplication. When Kipa sees a number, Kipa multiplies all of its digits together to build a new number, then repeats the same work on that new number. Once the number has only one digit there is nothing left to multiply, and Kipa becomes sad.
Write a program that prints how many steps Kipa's joy lasts. For example, 679 shrinks like this.
- 679→6×7×9=378 (step 1)
- 378→3×7×8=168 (step 2)
- 168→1×6×8=48 (step 3)
- 48→4×8=32 (step 4)
- 32→3×2=6 (step 5, the number now has one digit and Kipa becomes sad)
679 reaches one digit after 5 steps, so the answer is 5.