#include<stdio.h>
int main(void){
  char *s="python3 -c\""
"s=input()\n"
"n=len(s)-1\n"
"a=0\n"
"for i in range(1<<n):\n"
"  l=[]\n"
"  for x,y in zip(s,[''for _ in[0]*10]):\n"
"    l.append(x)\n"
"    l.append(y)\n"
"  for j in range(n):\n"
"    if i>>j&1:\n"
"      l[j*2+1]='+'\n"
"  a+=eval(''.join(l))\n"
"print(a)\n"
"\"";
  system(s);
  return 0;
}            