a=0 b=0 L = [2, 3, 4, 5, 10, 25] g = lambda x, n=0: n if x%2!=0 else g(x/2, n+1) f = lambda x, n=0: n if x%5!=0 else f(x/5, n+1) for x in L: a+=g(x) b+=f(x) print min(a,b)