n=gets.chomp;a=0 (n=n.chars.map(&:to_i).reduce(:*);a+=1)while n>0 p a