#pragma GCC optimize("Ofast") #include using namespace std; using ll = long long int ; using ld = long double ; using P = pair; using Graph= vector>; struct edge{ll to ; ll cost ;} ; using graph =vector> ; #define rep(i,n) for (ll i=0; i < (n); ++i) #define rep2(i,n,m) for(ll i=n;i<=m;i++) #define rep3(i,n,m) for(ll i=n;i>=m;i--) #define pb push_back #define eb emplace_back #define ppb pop_back #define mpa make_pair #define fi first #define se second #define set20 cout< struct BIT { int n; vector d; BIT(int n=0):n(n),d(n+1) {} void add(int i, T x=1) { //x=1ならsumは個数のカウント for (i++; i <= n; i += i&-i) { d[i] += x; } } T sum(int i) { T x = 0; for (i++; i; i -= i&-i) { x += d[i]; } return x; } T sum(int i,int j) { if(i>0) return sum(j)-sum(i-1); else return sum(j) ; } }; int main(){ ios::sync_with_stdio(false) ; cin.tie(nullptr) ; string s ;cin>>s ; ll k=s.size() ; ll bns=0ll ; rep(i,1<<(k-1)){ bitset<10> ss(i) ; ll ans=0ll ; ll now=s[0]-'0' ; rep(j,k-1){ if(ss[j]){ ans+=now ; now=0ll ; } now*=10 ; ll a=s[j+1]-'0' ; now+=a ; } ans+=now ; bool ok=0 ; //cout<