#include int fun(int n){int s=0;while(n){s+=n%10;n/=10;}return s;}void main(){int n;scanf("%d",&n);printf("%d",fun(n));}