#include <iostream>
using namespace std;
int main(){
unsigned long long int x,s = 0;
cin >> x;
while(x != 0){
s += x;
x /= 10;
}
cout << s;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBtYWluKCl7Cgp1bnNpZ25lZCBsb25nIGxvbmcgaW50IHgscyA9IDA7CgogICBjaW4gPj4geDsKCiAgIHdoaWxlKHggIT0gMCl7CgogICAgcyArPSB4OwoKICAgICAgIHggLz0gMTA7CgogICB9CgogICBjb3V0IDw8IHM7Cgp9Cg==