Persistent Number
Very easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
Given a number , we define a function as the product of the digits of . We can then form a sequence . The persistence of is then defined as the index (-based) of the first single digit number in the sequence. For example, using , we get the sequence . Thus, the persistence of is . You will be given , and you must find its persistence.
Input
Each line contains one integer .
Output
For each number print on a separate line its persistence.
Examples
Input #1
Answer #1
Submissions 3K
Acceptance rate 42%