n=int(input()) for _ in range(2,101): n=[i for i in str(n)] n=sum(int(i) for i in n) print(n)