#include<iostream>
#include<fstream>
#include<sstream>
#include<algorithm>
#include<cstdio>
#include<cassert>
#include<cmath>
#include<cstdlib>
#include<cstring>
#include<string>
#include<deque>
#include<queue>
#include<vector>
#include<list>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<iomanip>
#include<utility>
#include<functional>
using namespace std;
string s;
long long a[15][15];
long long a1[15];
long long ans;
int main()
{
	cin>>s;
	a[0][0]=(long long)1;
	a[0][1]=(long long)1;
	for(int i=2;i<s.size();i++)
		a[0][i]=a[0][i-1]*2;
	for(int i=1;i<s.size();i++)
	{
		a[i][i]=a[i-1][i-1]+a[i-1][i];
		for(int j=i+1;j<s.size();j++)
			a[i][j]=a[i-1][j];
	}
	a1[s.size()-1]=(long long)1;
	for(int i=s.size()-2;i>=0;i--)
		a1[i]=a1[i+1]*10;
	for(int i=0;i<s.size();i++)
	{
		long long ans1=0;
		for(int j=0;j<s.size();j++)
			ans1+=a1[j]*a[i][j];
		ans1*=s[i]-'0';
		ans+=ans1;
	}
	cout<<ans;
	return 0;
}
