//
// Written by Fyodor Menshikov 21.02.2006
// 3:20-3:46
// debug 24.02.2006 20:52-21:18
//
const
   _1000000000=1000000000;
var
   t:array[1..200000]of integer;
   len,digit,pow,i:integer;
   c:char;
   carry:int64;
begin
//   assign(input,'input.txt');
   reset(input);
//   assign(output,'output.txt');
   rewrite(output);
   t[1]:=0;
   len:=1;
   digit:=0;
   pow:=1;
   while true do begin
      read(c);
      assert(c in ['0','1']);
      digit:=digit*2+ord(c)-ord('0');
      pow:=pow*2;
      if (pow=1073741824) or eoln then begin
         carry:=0;
         for i:=1 to len do begin
            carry:=carry+int64(t[i])*pow;
            t[i]:=carry mod _1000000000;
            carry:=carry div _1000000000;
         end;
         while carry>0 do begin
            inc(len);
            t[len]:=carry mod _1000000000;
            carry:=carry div _1000000000;
         end;
         pow:=1;
         i:=1;
         while (digit>0) and (i<=len) do begin
            digit:=digit+t[i];
            t[i]:=digit mod _1000000000;
            digit:=digit div _1000000000;
            inc(i); // bug was here
         end;
         while digit>0 do begin
            inc(len);
            t[len]:=digit mod _1000000000;
            digit:=digit div _1000000000;
         end;
         assert(digit=0);
      end;
      if eoln then begin
         break;
      end;
   end;
   write(t[len]);
   for i:=len-1 downto 1 do begin
      digit:=t[i];
      pow:=_1000000000;
      while pow>1 do begin
         pow:=pow div 10;
         write(digit div pow);
         digit:=digit mod pow;
      end;
   end;
end.