input으로 들어온 수를 str으로 변환하여 각 자릿수를 더하여 답을 출력한다.
N = input() N = str(N) total = 0 for i in N: total += int(i) print(total)