#include #include #include #include #include #include using namespace std; using uint = unsigned int; using ll = long long; #define CIN( LL , A ) LL A; cin >> A #define GETLINE( A ) string A; getline( cin , A ) int main() { CIN( string , S ); const uint& size = S.size(); ll answer = 0; for( ll i = 0 ; i < size ; i++ ){ const string c = S.substr( i , 1 ); for( ll j = 1 ; j < 10 ; j++ ){ if( c == to_string( j ) ){ answer += j; j = 10; } } } cout << answer << endl; return 0; }