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.
Each line contains one integer .
For each number print on a separate line its persistence.