X=input() i=X.find('.') if i>=0:X,d=X[:i]+X[i+1:],10**(len(X)-i-1) else:d=1 n=int(X) a=0 while n:a,n,d=a+1,d%n,n print(a)