n=int(input())
res=[]
count=0
while(True):
    if(n in res):
        break
    else:
        res.append(n)
        n+=1
        n=str(n).rstrip('0')
        n=int(n)
        count+=1
print(count)
print(res)

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: