#include <stdio.h>
#include <math.h>

int main()
{
    int n;
    scanf("%d", &n);
    int he = 0;
    for (int i = 0; i <= 9; i++)
    {
        he += (int)(n / pow(10,9 - i)) % 10;
    }
    printf("%d", he);
    return 0;
}