#coding:utf-8
import math
#首先判断几位数
def diGit(n):
a = n
c = 0
while a != 0:
a = a / 10
c += 1
return c
def sumDigits(n):
c = diGit(n) #判断几位数
if n < 10:
return n
else:
l = int(n / math.pow(10, c -1)) #取最高位
#print l
y = int(n – l * math.pow(10, c-1)) #取最高位后剩余
#print j
n = l + sumDigits(y)
return n
def main():
i = int(raw_input(unicode(‘请输入任意整数’,’utf-8′).encode(‘gbk’)))
sum = sumDigits(i)
print sum
main()