#include <stdio.h> int main(){ int n; scanf("%d",&n); int w=0; int a; while(n!=0){ a=n%10; n=n/10; w=w+a; } printf("%d",w); }