#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n,kq = 0;
int main()
{
ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
freopen("TONGCHUSO.inp", "r", stdin);
freopen("TONGCHUSO.out", "w", stdout);
cin >> n;
while(n != 0)
{
kq+=n%10;
n/=10;
}
cout << kq;
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2RlZmluZSBsbCBsb25nIGxvbmcKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKbGwgbixrcSA9IDA7CmludCBtYWluKCkKewogICAgaW9zX2Jhc2U6OnN5bmNfd2l0aF9zdGRpbygwKTsgY2luLnRpZSgwKTsgY291dC50aWUoMCk7CiAgICBmcmVvcGVuKCJUT05HQ0hVU08uaW5wIiwgInIiLCBzdGRpbik7CiAgICBmcmVvcGVuKCJUT05HQ0hVU08ub3V0IiwgInciLCBzdGRvdXQpOwogICAgY2luID4+IG47CiAgICB3aGlsZShuICE9IDApCiAgICB7CiAgICAgICAga3ErPW4lMTA7CiAgICAgICAgbi89MTA7CiAgICB9CiAgICBjb3V0IDw8IGtxOwp9Cg==