# 把数字当字符串处理

n = input().strip()           # 读入四位数,.strip保证读到的是干净的数据。 n= “1234”,字符串
print(sum(int(d) for d in n)) # “把字符串里的每个字符,先转成 int数字,依次生成出来”。