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