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