#include<stdio.h>
int main()
{ int a,n,i = 10,k = 0,j,s = 0,t; scanf("%d",&a); while(!(n > 0&&n < 10))//计算位数 { n = a / i; i = i * 10; k = k + 1; } n = 0; i = 10; s = a % 10;//输出个位 for(j = 1;j <= k;j++)//输出其他位数 { t = n; i = i*10; n = a % i; s = s+(n - t)/(i/10); } printf("%d",s);