#include <stdio.h> int main(void) { int n, i = 0, j, sum = 0; int a[10]; scanf("%d", &n); while(n / 10 != 0) { a[i] = n% 10; n = n /10; i++; } for(j = 0; j < i; j++) { sum = sum + a[j]; } sum = sum + n; printf("%d", sum); return 0; }