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