#include using namespace std; #define REP(i,N) for(i=0;i P; typedef struct{ int first; int second; int third; }T; //昇順 bool comp_Se(T& l, T& r){ return l.second < r.second; } int main(void){ string S; string num="123456789"; cin >> S; int i,j,sum=0; REP(i,S.size())REP(j,num.size()) if(num[j] == S[i]) sum += j+1; cout << sum << endl; return 0; }