#include <stdio.h> int main() { int n; scanf("%d",&n); if(n<0)n=-n; int t,sum=0; while(n>0){ t=n%10; n/=10; sum+=t; } printf("%d\n",sum); return 0; }