#include<bits/stdc++.h> using namespace std; int n,x,c,i=1; int main(){ cin>>x; while(x){ c+=x%10*i; x/=10; i++; } cout<<c; return 0; }