Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them.Each command is one of the following two types:   Go 1 unit towards the positive direction, denoted as '+'  Go 1 unit towards the negative direction, denoted as '-' But the Wi-Fi condition is so poor that Dreamoon's smartphone reports some of the commands can't be recognized and Dreamoon knows that some of them might even be wrong though successfully recognized. Dreamoon decides to follow every recognized command and toss a fair coin to decide those unrecognized ones (that means, he moves to the 1 unit to the negative or positive direction with the same probability 0.5). You are given an original list of commands sent by Drazil and list received by Dreamoon. What is the probability that Dreamoon ends in the position originally supposed to be final by Drazil's commands?

The first line contains a string s1 — the commands Drazil sends to Dreamoon, this string consists of only the characters in the set {'+', '-'}.  The second line contains a string s2 — the commands Dreamoon's smartphone recognizes, this string consists of only the characters in the set {'+', '-', '?'}. '?' denotes an unrecognized command. Lengths of two strings are equal and do not exceed 10.

Output a single real number corresponding to the probability. The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 9.

NoteFor the first sample, both s1 and s2 will lead Dreamoon to finish at the same position  + 1. For the second sample, s1 will lead Dreamoon to finish at position 0, while there are four possibilites for s2: {"+-++", "+-+-", "+--+", "+---"} with ending position {+2, 0, 0, -2} respectively. So there are 2 correct cases out of 4, so the probability of finishing at the correct position is 0.5. For the third sample, s2 could only lead us to finish at positions {+1, -1, -3}, so the probability to finish at the correct position  + 3 is 0.

var
  n, m, i, ans, p, en, pos, pos2: longint;
  s1, s2: string;
begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(p)
    else
      dec(p);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(p)
    else if s2[i] = '-' then
      inc(p)
    else
      inc(en);
  if p < 0 then
    p := -p;
  {writeln(p, ' ', en);}
  if (p > en) or ((p + en) mod 2 <> 0) then
    begin
      write(0);
      exit();
    end;
  pos := 1;
  p := (en + p) div 2;
  for i := en - p + 1 to en do
    pos := pos * i;
  pos2 := 1;
  for i := 1 to p do
    pos := pos div i;
  for i := 1 to en do
    pos2 := pos2 * 2;
  write(pos / pos2);
end.

Uses    math;
Const   Fi      =       '';//'476B.INP';
        Fo      =       '';//'asdf.out';
Var     F1,F2   :       text;
        S1,S2   :       String;
        Vt      :       longint;
        Vtg     :       longint;
        Sl1,Sl2 :       longint;
Procedure       Mofile;
Begin
        Assign(f1,fi);
        Reset(f1);
        Assign(f2,fo);
        Rewrite(f2);
End;
///////////////////////////
Procedure       Docfile;
Var     i,j     :       longint;
Begin
        Readln(f1,S1);
        Readln(f1,S2);
        Vtg:=0;
        For i:=1 to Length(S1) do
        If S1[i] = '+' then
                Inc(Vtg)
        Else
                Dec(Vtg);
End;
////////////////////////////
Procedure       Try1(I:longint; Vt:longint);
Begin
        If I > Length(S2) then
        Begin
                If Vt = Vtg then Inc(Sl1);
                Inc(Sl2);
                Exit;
        End;
        If (S2[i] = '+') or (S2[i] ='?') then
                Try1(I+1,Vt+1);
        If (S2[i] = '-') or (S2[i] ='?') then
                Try1(I+1,Vt-1);
End;
///////////////////////////
Procedure       Xulyfile;
Var     i,j     :       longint;
Begin
        Try1(1,0);
        Writeln(f2,Sl1 / Sl2 :0:12);
End;
/////////////////////////////
Procedure       Dongfile;
Begin
        Close(f1);
        Close(f2);
End;
//////////////////////////////
Begin
        Mofile;
        Docfile;
        Xulyfile;
        Dongfile;
End.

var s2,s1:string;
i,dem,dem1,c,x,y:longint;
{----------------}
function gt(x:Longint):int64;
begin
        if x<=1 then gt:=1
        else gt:=gt(x-1)*x;
end;
{-----------------}
function count(a:string):longint;
var tg,t:longint;
begin
        tg:=0;
        for t:=1 to length(a) do
        begin
                if a[t]='+' then inc(tg);
                if a[t]='-' then dec(tg);
        end;
        exit(tg);
end;
{----------------}
function mu(y:longint):longint;
var i,tg:longint;
begin
        tg:=1;
        for i:=1 to y do tg:=tg*2;
        exit(tg);
end;
{----------------}
begin
        readln(s1);
        readln(s2);
        if pos('?',s2)=0 then
        begin
                if count(s1)=count(s2) then write(1/1)
                else write(0/1);
        end
        else
        begin
        for i:=1 to length(s2) do
                if s2[i]='?' then inc(dem);
        dem1:=count(s1)-count(s2);
        if ((dem1<0) and (dem1<-dem)) or ((dem1>0) and (dem1>dem)) then write(0/1)
        else
        begin
        c:=abs((dem-dem1) div 2);
        write(gt(dem)/(gt(c)*gt(dem-c)*mu(dem)));
        end;
        end;
end.

var s1, s2:string;
    i, kp1, kp2, km1, km2, n, kv, km, kp:longint;
    a, st, ans:real;
begin

readln(s1);
readln(s2);
n:=length(s1);

for i:=1 to n do
 if s1[i]='+' then inc(kp1)
              else inc(km1);

for i:=1 to n do
 if s2[i]='+' then inc(kp2)
              else if s2[i]='-' then inc(km2)
                                else inc(kv);

if (km1<km2)or(kp1<kp2) then writeln(0)
           else begin

                st:=1; a:=1;
                for i:=1 to kv do
                 begin
                 st:=st*2;
                 a:=a*i;
                 end;

                kp:=1;
                for i:=1 to kp1-kp2 do
                 kp:=kp*i;

                km:=1;
                for i:=1 to km1-km2 do
                 km:=km*i;

                a:=a/kp;
                a:=a/km;
                ans:=a/st;

                writeln(ans);

                end;

end.

const {fi='checking.inp';
      fo='checking.out';}
       d:array[1..2]of integer=(-1,1);
var s1,s2:string;
        p,po,dem:integer;
        cnt:longint;
{------------------------}
{procedure openfiles;
begin
        assign(input,fi);
        reset(input);
        assign(output,fo);
        rewrite(output);
end; }
{------------------------------}
{procedure  closefiles;
begin
        close(input);close(output);
end;}
{-------------------------}
procedure stdin;
begin
        readln(s1);
        readln(s2);
end;
{------------------------------------}
procedure backtrack(x:longint);
var i:longint;
begin
        if (x=0) and (po=p)  then inc(cnt);
        for i:=1 to 2 do
        begin
                inc(po,d[i]);
                if (x>0) then backtrack(x-1);
                dec(po,d[i]);
        end;

end;
{-------------------------------}
function lt(y:integer):longint;
var  i,s:longint;
begin
        s:=1;
        for i:=1 to y do s:=s*2;
        exit(s);
end;
{-------------------------------}
procedure process;
var   kq:real;
        i:longint;
begin
        for i:=1 to length(s1) do
        if s1[i]='+' then inc(p) else dec(p);

        for i:=1 to length(s2) do
        begin
                if s2[i]='+' then inc(po)
                else if s2[i]='-' then dec(po);
                if s2[i]='?' then inc(dem);
        end;

        if (dem<>0)then
        begin
                backtrack(dem);
                kq:=cnt/lt(dem);
        end
        else if (po=p)then  kq:=1;

        writeln(kq);

end;
{---------------------------------}
BEGIN
     {   openfiles; }
        stdin;
        process;
       { closefiles;}
END.

var
    s1,s2:ansistring;
    sum1,sum2,c,dem,hieu:longint;

function  tohop(k,n:longint):longint;
var tu,mau1,mau2,i:longint;
begin
    tu:=1;
    for i:=1 to n do tu:=tu*i;
    mau1:=1;
    for i:=1 to k do mau1:=mau1*i;
    mau2:=1;
    for i:=1 to n-k do mau2:=mau2*i;
    exit(tu div (mau1*mau2));
end;

procedure nhapdem;
var l,i,j:longint;
begin
    sum1:=0; sum2:=0; dem:=0;
    readln(s1); readln(s2);
    l:=length(s1);
    for i:=1 to l do
    begin
        if s1[i]='+' then inc(sum1)
            else dec(sum1);
    end;
    for j:=1 to l do
    begin
        if s2[j]='+' then inc(sum2);
        if s2[j]='-' then dec(sum2);
        if s2[j]='?' then inc(dem);
    end;
    hieu:=sum1-sum2;
end;

function xuli:real;
var   kq:real;    i,plus,minus,sth:longint;
begin
    sth:=1;
    for i:=1 to dem do sth:=sth*2;
    if (dem=0) and (hieu=0) then exit(1);
    if (dem=0) and (hieu<>0) then exit(0);
    if (dem>0 ) then
    begin
        if (abs(dem-hieu) mod 2 =0) and (abs(dem+hieu) mod 2 = 0) then
        begin
            plus:=(dem+hieu) div 2;
            minus:=(dem-hieu) div 2;
            if minus=0 then exit(1/sth);
            kq:=tohop(plus,dem)/sth;
            exit(kq);
        end
        else exit(0);
    end
    else exit(0);
end;

begin
    nhapdem;
    writeln(xuli);
end.

var
k,k0,i,p1,p2,Sum,L,q,j,t,R:longint;
s1,s2:string;

BEGIN
Sum:=0;
readln(s1);
L:=Length(s1);
if(L=1) then begin R:=2;k0:=1;end;
if(L=2) then begin R:=4;k0:=2;end;
if(L=3) then begin R:=8;k0:=4;end;
if(L=4) then begin R:=16;k0:=8;end;
if(L=5) then begin R:=32;k0:=16;end;
if(L=6) then begin R:=64;k0:=32;end;
if(L=7) then begin R:=128;k0:=64;end;
if(L=8) then begin R:=256;k0:=128;end;
if(L=9) then begin R:=512;k0:=256;end;
if(L=10) then begin R:=1024;k0:=512;end;

p1:=0;
q:=0;

for i:=1 to L do begin
if(s1[i]='+') then begin p1:=p1+1;end
else begin p1:=p1-1;end;
end;

readln(s2);
for j:=1 to L do begin
if(s2[j]='?') then begin q:=q+1;end;
end;

for i:=0 to R-1 do begin

k:=k0;p2:=0;t:=0;

for j:=1 to L do begin
if(i and k<>0)and((s2[j]='+')or(s2[j]='?'))then begin
p2:=p2+1;t:=t+1;end;

if(i and k=0)and((s2[j]='-')or(s2[j]='?'))then begin
p2:=p2-1;t:=t+1;end;

k:=k div 2;
end;

if(t=L)and(p2=p1) then begin Sum:=Sum+1;end;

end;

if(q=0)and(Sum=1) then begin writeln('1');end;
if(q=0)and(Sum=0) then begin writeln('0');end;
if(q<>0) then begin
k:=1;
for i:=1 to q do begin
k:=k*2;
end;
writeln(Sum/k);
end;
END.

{$MODE OBJFPC}
Program Only_LOve;
var s1,s2 : ansistring ;
    c2,c1,i,dem,p : integer;
    xx,l,k : real;
Begin
  Readln(s1);
  Readln(s2);
  c1 :=0;c2:=0;dem:=0;k:=1; l:=1;
  for i:=1 to length(s1) do
    begin
      if s1[i]='+' then inc(c1);
      if s1[i]='-' then Dec(c1);
    end;
  for i:=1 to length(s2) do
    begin
      if s2[i]='+' then Inc(c2);
      if s2[i]='-' then Dec(c2);
      if s2[i]='?' then inc(dem);
    end;
  for i:=1 to dem do k:= k*2;
  p:=c1 -c2 ;
  p := dem -p ;
  if p mod 2 <> 0 then l:= 0;
  if (p mod 2 = 0) and (p >= 0) then
    begin
      p:= p div 2 ;
      for i:=0 to p-1 do l:=l*(dem-i)/(p-i);
    end
    else l:=0;
  xx := l / k;
  Write(xx:0:12);

end.

program codeforces_476B;
type niz=array[1..10] of integer;
var s1,s2:string;
      a:niz;
      i,j,br,br2,br3,p1,p2,p3:integer;
function brojanje (var a:niz;n:integer):integer;
  var i,j:integer;
  begin
     i:=n;
     while (i>0) and (a[i]=1) do i:=i-1;
     if (i=0) then brojanje:=0
     else
       begin
         brojanje:=1;
         a[i]:=1;
         for j:=i+1 to n do a[j]:=0;
       end;
  end;
begin
  readln (s1);
  readln (s2);
  p1:=0;
  for i:=1 to length (s1) do
    if (s1[i]='+') then p1:=p1+1
    else p1:=p1-1;
  br:=0;
  p2:=0;
  for i:=1 to length (s2) do
    begin
       if (s2[i]='+') then p2:=p2+1
       else if (s2[i]='-') then p2:=p2-1
              else br:=br+1;
    end;
  for i:=1 to br do a[i]:=0;
  br2:=1;
  repeat
    p3:=0;
    for i:=1 to br do
      if (a[i]=1) then p3:=p3+1
      else p3:=p3-1;
    if (p2+p3=p1) then br3:=br3+1;
    br2:=br2+1;
  until (brojanje (a,br)=0);
  br2:=br2-1;
  writeln (br3/br2:2:12);
end.

{$MODE OBJFPC}
Const
  Fi='';//476B.INP';
  Fo='';//476B.OUT';
Var s1,s2:String;
    a,Gt:Array[0..11] of Longint;
    F:Array[-11..11,0..11] of Real;
    C:Array[0..11,0..11] of Longint;
    COunt1,Count2,Count:Longint;

Procedure Init;
Var j,i:Longint;
Begin
  a[1]:=2;
  For i:=2 to 11 do
    a[i]:=a[i-1]*2;
  Gt[0]:=1;
  For i:=1 to 10 do
    Gt[i]:=Gt[i-1]*i;

  For i:=1 to 10 do
    For j:=i downto 0 do
      C[j,i]:=(Gt[i] div (Gt[i-j]*Gt[j]));
  C[0,0]:=0;

  For i:=10 downto 0 do
    For j:=1 to 10 do
      If j<i then
        Begin
          F[i,j]:=0;
          F[-i,j]:=0;
        End
      Else
        If i=j then
          Begin
            F[i,j]:=1/a[i];
            F[-i,j]:=1/a[i];
          End
        Else
          If (j-i) mod 2<>0 then
            Begin
              F[i,j]:=0;
              F[-i,j]:=0;
            End
          Else
            Begin
              F[i,j]:=C[(j-i) div 2,j]/a[j];
              F[-i,j]:=F[i,j];
            End;
End;

Procedure Enter;
Var i:Longint;
Begin
  Readln(s1);
  Readln(s2);
End;

Procedure Main;
Var j,i:Longint;
Begin
  Init;
  COunt1:=0;
  Count2:=0;
  COunt:=0;
  For i:=1 to length(s1) do
    Begin
      Case s1[i] of
        '+':Inc(Count1);
        '-':Dec(Count1);
      End;
      Case s2[i] of
        '+':Inc(Count2);
        '-':Dec(Count2);
        '?':Inc(Count);
      End;
    End;
  If (COunt=0) and (COunt1=COunt2) then
    Writeln(1.0:0:12)
  Else
    If (Count=0) or (Count1-Count2>10) then Writeln('0.000000000000')
    Else
      If F[Count1-COunt2,Count]=0 then
        Writeln('0.000000000000')
      Else
        Writeln(F[Count1-Count2,Count]:0:12);
End;

BEGIN
  Assign(Input,Fi); Reset(Input);
  Assign(Output,Fo); Rewrite(Output);

  Enter;
  Main;

  Close(Input);
  Close(Output);
END.

var S1,S2:string;
    a,b,c:longint;
    i:longint;
    kq:longint;
    temp:real;

function gt(r:longint):longint;
var i:longint;
    t:int64;
begin
    t:=1;
    for i:=1 to r do t:=t*i;
    exit(t);
end;

function Tinh(c,a:longint):longint;
var i:longint;
begin
    kq:=1;
    for i:=1 to a do kq:=kq*(c-i+1);
    kq:=kq div gt(a);
end;

begin
    readln(S1);
    readln(S2);
    a:=0;
    b:=0;
    c:=0;
    for i:=1 to length(S1) do
    begin
        if S1[i]='+' then inc(a);
        if S1[i]='-' then inc(b);
    end;
    for i:=1 to length(S2) do
    begin
        if S2[i]='+' then dec(a);
        if S2[i]='-' then dec(b);
        if S2[i]='?' then inc(c);
    end;
    temp:=0;
    if (a<0) or (b<0) or (a+b<>c) then
    begin
        writeln(temp:0:12);
        exit;
    end
    else
        writeln(Tinh(c,a)/(1 SHL c):0:12);
end.

var
  s : ansistring;
  xx,i,ss,sk : longint;
  f : boolean;

  procedure rec(x,j : longint);
    begin
      if j > length(s) then begin
        inc(ss);
        if x = xx then inc(sk);
        exit;
      end;
      if s[j] = '+' then rec(x+1,j+1) else
      if s[j] = '-' then rec(x-1,j+1) else begin
        rec(x+1,j+1);
        rec(x-1,j+1);
      end;
    end;

begin
  readln(s);
  for i:=1 to length(s) do if s[i] = '+' then inc(xx) else dec(xx);
  readln(s);

  rec(0,1);
  if sk = 0 then writeln('0.00000000000000000') else writeln(sk/ss:0:9);
end.

program Hate;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var obs,i,pl,mi,vo,raz:integer;
    ans,cor:real;
    s,s1:string;

procedure per(ch:integer; var s:string);
begin
 while ch>0 do
 begin
  if ch mod 2 = 1 then s:='+'+s else s:='-'+s;
  ch:=ch div 2;
 end;
 while length(s)<vo do s:='-'+s;
end;

function prov(s:string):boolean;
var plo,mio,i:integer;
begin
 plo:=0;
 mio:=0;
 for i:=1 to length(s) do
  if s[i]='+' then inc(plo) else inc(mio);
 if plo-mio=raz then prov:=true else prov:=false;
end;

begin
  { TODO -oUser -cConsole Main : Insert code here }
//assign(input,'input.txt');reset(input);
//assign(output,'output.txt');rewrite(output);

pl:=0; mi:=0; vo:=0;

readln(s);
for i:=1 to length(s) do
 if s[i]='+' then inc(pl) else inc(mi);

readln(s);
for i:=1 to length(s) do
 if s[i]='+' then dec(pl) else
  if s[i]='-' then dec(mi) else
   inc(vo);

raz:=pl-mi;

if vo=0 then
begin
 if (mi<0) or (pl<0) then ans:=0 else ans:=1;
end
else
begin
 obs:=1 shl vo;
 cor:=0;
 for i:=0 to obs-1 do
 begin
  per(i,s1);
  if prov(s1) then cor:=cor+1;
  s1:='';
 end;
 ans:=cor/obs;
end;

writeln(ans:0:15);

//close(input);close(output);
end.

var s:string;
xx,yy:real;
i,t:Longint;
procedure sc(x,y:longint);
begin
if x=length(s)+1 then
  begin
  if y=t then yy:=yy+1;
  exit;
  end;
if s[x]='?' then
  begin
  sc(x+1,y-1);
  sc(x+1,y+1);
  end
else
  begin
  if s[x]='+' then
    sc(x+1,y+1)
  else sc(x+1,y-1);
  end;
end;
begin
//assign(output,'wifi.out');rewrite(output);
readln(s);
for i:=1 to length(s) do
  if s[i]='+' then inc(t) else dec(t);
readln(s);
xx:=1;
for i:=1 to length(s) do
  if s[i]='?' then
    xx:=xx*2;
sc(1,0);
if yy=0 then writeln(yy:0:12)
else writeln(yy/xx:0:12);
close(input);close(output);
end.

program B467;
var
    s1, s2: string;
    p1, p2, i: longint;
    mauso, tuso: real;
    free: array[1..11] of boolean;

procedure check;
var i: longint;

begin
//    writeln(free[1]);
//    writeln(s2);
    p2 := 0;
    // code goes here
    for i := 1 to length(s2) do
        if  s2[i] = '+' then inc(p2) else dec(p2);
    mauso := mauso + 1;
    if p2 = p1 then tuso := tuso+1;
end;

procedure Ttry(i: longint);
var j: longint;
begin
    if i-1 = length(s1) then check
    else begin
        for j := 0 to 1 do begin
            if free[i] then begin
                if j = 0 then s2[i] := '-'
                else s2[i] := '+'
            end;
            Ttry(i+1)
        end;
    end;
end;
begin
    readln(s1);
    readln(s2);
    if s2 = '?' then begin writeln(0.500000); exit; end;
    fillchar(free, sizeof(free), FALSE);
    for i := 1 to length(s1) do
        if s1[i] = '+' then inc(p1) else dec(p1);
    for i := 1 to length(s2) do
        if s2[i] = '?' then free[i] := true;
    Ttry(1);

    writeln((tuso/mauso):0:9);
    readln
end.

var
ss,s:string;
i:longint;

p,q,qq,nez,x,otr,plus,kol:int64;
begin
readln(s);
readln(ss);
for i:=1 to length(s) do if s[i]='+' then inc(plus)
else
inc(otr);

for i:=1 to length(ss) do begin
    if ss[i]='+' then dec(plus);
    if ss[i]='-' then dec(otr);
    if ss[i]='?' then inc(nez);
end;
x:=1;
for i:=1 to nez do x:=x*2;

if (plus<0)or(otr<0) then writeln(0)
else begin
p:=1;
for i:=plus+1 to  nez do p:=p*i;
q:=1;
for i:=1 to (nez-plus) do q:=q*i;
qq:=round(p/q);
writeln(qq/x:0:11);
end;
end.

var a,a1:string;
    b:array[1..100]of LongInt;
    i:LongInt;
    norm,gg,vop,use,prav:LongINt;

procedure rec(x,sum:LongInt);
Begin
  if(x=vop+1)then begin inc(use); if(sum=norm)then inc(prav); exit; end;
  rec(x+1,sum-1);
  rec(x+1,sum+1);
End;

Begin
   ReadLn(a);
   for i:=1 to length(a)do
     if(a[i]='+')then inc(norm)
     else dec(norm);
   ReadlN(a1);
   for i:=1 to length(a1)do
     if(a1[i]='+')then inc(gg)
     else if(a1[i]='-')then dec(gg)
     else inc(vop);
   rec(1,gg);

   Write((prav/use):0:15);
End.

Program CFDreamoonAndWifi;
type vector=array[0..10000] of char;
var i, n, r1, r2, v, c:integer;
    a, b:vector;
    yes:boolean;
procedure Compara(r2, r1:integer);
begin
        if r2=r1 then
        begin
           c:=c+1;
        end
end;
procedure Citire;
var l, m:integer;
begin
        l:=0;
        a[0]:='+';
        while a[l] in ['+', '-', '?'] do
        begin
             l:=l+1;
             read(a[l]);
        end;
        n:=l-1;
        for m:=1 to n do
                b[m]:='X'
end;
procedure AfisareMem;
var l:integer;
begin
        for l:=1 to n do
        begin
                if b[l]='X' then b[l]:=a[l];
        end;
        v:=v+1;
end;
procedure Calcul(b:vector);
var k, r:integer;
begin
    r:=0;
    for k:=1 to n do
        if b[k]='-' then r:=r+1;
    r:=n-r-r;
    r1:=r;
    if yes then
        Compara(r2, r1);
end;
procedure GenCod(j:integer);
begin
        if j>n then
        begin
                AfisareMem;
                Calcul(b);
        end
        else
        begin
                if a[j]='?' then
                begin
                        b[j]:='+';
                        GenCod(j+1);
                end;
                if a[j]='?' then
                        b[j]:='-';
                GenCod(j+1);
        end;
end;

begin
        yes:=false;
        c:=0;
        v:=0;
        Citire;
        GenCod(1);
        r2:=r1;
        readln;
        yes:=true;
        v:=0;
        Citire;
        GenCod(1);
        writeln(c/v:1:12);
        readln;
        readln
end.

{$H}
{$COPERATORS ON}
var  s1,s2:string;
     sum1,sum2,c,i,k,m,p:longint;
     res:real;
begin

        readln(s1);
        readln(s2);
        sum1:=0;
        sum2:=0;
        c:=0;
        for i:=1 to length(s1) do
                if s1[i]='+' then sum1+=1
                        else
                                sum1-=1;

         for i:=1 to length(s2) do
                if s2[i]='+' then sum2+=1
                        else
                                if s2[i]='-' then sum2-=1
                                        else
                                                c+=1;
         k:=sum1-sum2;
        if ((k+c) mod 2  <>0) or (c<abs(k)) then res:=0
                else
                        begin
                                m:=(c+abs(k)) >>1;
                                p:=1;
                                for i:=0 to m-1 do
                                        p*=c-i;
                                for i:=2 to m do
                                        p:=p div i;
                                res:= p/(1<<c);
                        end;
                write(res:0:9);

end.

var s1,s2:string;
    d,i,k,t,ii,k1,k0:longint;
    dd:real;
begin
readln(s1);
readln(s2);
for i:=1 to length(s1) do
   if s1[i]='+' then inc(k) else dec(k);
for i:=1 to length(s1) do
   if s2[i]='+' then dec(k) else
      if s2[i]='-' then inc(k) else inc(t);
if abs(k)>t then write(0.000000000) else
   begin
   d:=1;
   for i:=1 to t do
     d:=d*2;
   for i:=0 to d-1 do
      begin
      ii:=i;
      k1:=0;
      k0:=0;
      while ii>0 do
         begin
         if odd(ii) then inc(k1);
         ii:=ii div 2;
         end;
      k0:=t-k1;
      if k0*-1+k1 = k then dd:=dd+1;
      end;
   write(dd/d:0:12);
   end;
end.

program codeforces_476b;
type niz=array[1..10] of integer;
var s1,s2:string;
      a:niz;
      i,j,br,br2,br3,p1,p2,p3:integer;
function brojanje (var a:niz;n:integer):integer;
  var i,j:integer;
  begin
     i:=n;
     while (i>0) and (a[i]=1) do i:=i-1;
     if (i=0) then brojanje:=0
     else
       begin
         brojanje:=1;
         a[i]:=1;
         for j:=i+1 to n do a[j]:=0;
       end;
  end;
begin
  readln (s1);
  readln (s2);
  p1:=0;
  for i:=1 to length (s1) do
    if (s1[i]='+') then p1:=p1+1
    else p1:=p1-1;
  br:=0;
  p2:=0;
  for i:=1 to length (s2) do
    begin
       if (s2[i]='+') then p2:=p2+1
       else if (s2[i]='-') then p2:=p2-1
              else br:=br+1;
    end;
  for i:=1 to br do a[i]:=0;
  br2:=1;
  repeat
    p3:=0;
    for i:=1 to br do
      if (a[i]=1) then p3:=p3+1
      else p3:=p3-1;
    if (p2+p3=p1) then br3:=br3+1;
    br2:=br2+1;
  until (brojanje (a,br)=0);
  br2:=br2-1;
  writeln (br3/br2:2:12);
end.

var s1,s2:string;
    bit,n1,n2,dem,dem1,org,en,en1,i,j:longint;
    xs:real;
function getbit(x:longint;i:longint):longint;
  begin
    getbit:=(x shr i) and 1;
  end;
begin
 readln(s1);
 readln(s2);
 n1:=length(s1);
 n2:=length(s2);
 org:=0;
 en:=0;
 dem:=0;
 for i:=1 to n1 do
   if s1[i]='+' then inc(org) else dec(org);
 bit:=1;
 for i:=1 to n2 do
  begin
   if s2[i]='+' then inc(en);
   if s2[i]='-' then dec(en);
   if s2[i]='?' then
     begin
       bit:=bit*2;
       inc(dem);
     end;
  end;
 dem1:=0;
 if dem<>0 then
 begin
 for i:=0 to bit-1 do
  begin
   en1:=en;
    for j:=0 to dem-1 do
      begin
        if getbit(i,j)=1 then inc(en1) else dec(en1);
      end;
    if en1=org then inc(dem1);
  end;
 xs:=dem1/bit;
 end
 else
   if en=org then xs:=1 else xs:=0;

 writeln(xs:0:12);

end.

const fi='';
      fo='';
var a:array [1..10] of integer;
    x,y:string; pos,dem,tam,thoa:longint;
    f:text;
procedure nhap;
var i,j:longint;
begin
    pos:=0; dem:=0; tam:=0; thoa:=0;
    assign(f,fi); reset(f);
    readln(f,x);
    for i:=1 to length(x) do
    if (x[i]='+') then inc(pos) else dec(pos);
    readln(f,y);
    for j:=1 to length(y) do
    if (y[j]='?') then inc(dem)
    else if (y[j]='+') then inc(tam) else dec(tam);
    close(f);
end;
procedure count(b:longint);
var sum,i,j:longint;
begin
    for i:=0 to 1 do
    begin
        a[b]:=i;
        if (b=dem) then
        begin
            sum:=0;
            for j:=1 to dem do
            if (a[j]=0) then inc(sum) else dec(sum);
            if (tam+sum=pos) then inc(thoa);
        end else count(b+1);
    end;
end;
procedure xuat;
var kq:real; i,k,mu:longint;
begin
    assign(f,fo); rewrite(f);
    if (dem=0) then if (tam=pos) then
    begin
        writeln(f,1);
        close(f);exit;
    end else
    begin
        writeln(f,0);
        close(f); exit;
    end;
    count(1); mu:=1;
    for i:=1 to dem do mu:=mu*2;
    kq:=thoa/mu;
    writeln(f,kq:0:1000000000);
    close(f);
end;
begin
    nhap;
    xuat;
end.

var s1,s2:string;
    i,j,n,len,mov,anspos,finpos,dis,m:longint;
    ans,c:real;

begin
 readln(s1);
 readln(s2);
 n:=length(s1);

 for i:=1 to n do
  if s1[i] = '+' then inc(anspos)
                else dec(anspos);

 for i:=1 to n do
  if s2[i] = '?' then inc(mov)
                 else if s2[i] = '+' then inc(finpos)
                                     else dec(finpos);

 dis:=anspos-finpos;

 if ((dis+mov) mod 2 <> 0)  and (mov< abs(dis))
  then ans:=0
  else
   begin
    m:=(mov+abs(dis)) div 2;
    c:=1;
    for i:=0 to m-1 do
     c:= c* (mov-i);
    for i:=2 to m do
     c:= c/i;
    ans:=c / (1 shl mov);
   end;
 writeln(ans);
end.

//476b
var
    t,p,z,i:longint;
    s1,s2:string;
    n,f:extended;
function x(n:integer):longint;
var  l:longint;k:longint;
begin
  l:=1;
  for k:=1 to n do
   l:=k*l;
   x:=l;
end;

begin
  readln(s1);
  readln(s2);
  t:=0;
  for i:=1 to length(s1) do
     if s1[i]='+' then inc(t) else dec(t);
  for i:=1 to length(s1) do
     if s2[i]='+' then inc(z) else if s2[i]='-' then dec(z) else inc(p);
  t:=abs(t-z);
  if (t>p)or ((t+p)mod 2=1) then write(0) else begin
      t:=(p+abs(t))div 2;
  n:=1*1 shl p;
  f:=x(p)/x(p-t)/x(t);
  f:=f/n;
  write(f);

  end;
end.

function fact(n:longint):longint;
var
i,s:longint;
begin
s:=1;
for i:=1 to n do
s:=s*i;
fact:=s;
end;
function st(n:longint):longint;
var
i,s:longint;
begin
s:=1;
for i:=1 to n do
s:=s*2;
st:=s;
end;

function c(a,b:longint):longint;
begin
c:=fact(b) div (fact(a)*fact(b-a));
end;

var
s1,s2:string;
n,i,k1,k2,p,x:longint;
v:real;
begin
readln(s1);
readln(s2);
n:=length(s1);
k1:=0;
k2:=0;
p:=0;
for i:=1 to n do
if s1[i]='+' then inc(k1)
else dec(k1);

for i:=1 to n do
if s2[i]='+' then inc(k2) else
if s2[i]='-' then dec(k2) else
inc(p);

//writeln(k1,' ',k2,' ',p);
if abs(k1-k2)>p then
         begin
         write(0);
         exit;
         end;
if (p+k1-k2) mod 2=1 then
begin
write(0);
exit;
end
else
begin
x:=(p+k1-k2) div 2;
//writeln('x=',x);
//writeln('p=',p);
//writeln(c(x,p));
//writeln(st(p));
v:=c(x,p)/st(p);
write(v);
end;
end.

//Balsa Knezevic
//codeforces.com
{Data su dva stringa iste duzine.Prvi string sastavljen je iz
+ i -. Plus povecava njegovu koordinatu za 1, minus smanjuje.
Drugi string se sastoji iz +,- i ?. Kolike su sanse
da zamenom ? sa + ili - dobijemo istu krajnju poziciju kao
u prvom stringu.}
uses math;
var  s1,s2:ansistring;
k,p,q,step,znk,pok1,pok2,l,plus,minus,o,brojac,sol:int64;
g:array[-1000..10000] of integer;

i:longint;
begin
 readln(S1);
 readln(s2);

 for i:=1 to length(S1) do begin
  if (s1[i]='+') then inc(pok1) else dec(pok1);
  end;

 for i:=1 to length(s2) do begin
  if (s2[i]='+') then inc(pok2) else
  if (S2[i]='-') then dec(pok2) else
   inc(znk);
   end;

 //writeln(pok1,' ',pok2,'  ',znk);

   if (pok1=pok2) and(znk=0) then begin
    writeln(1/1:0:12);
    exit;
    end;
  {
   if (pok1=pok2) and(znk mod 2=1) then begin
    writeln(0/1:0:12);
    exit;
    end;

   if (pok1<>pok2) and (abs(pok1-pok2)>znk) then begin
    writeln(0/1:0:12);
    exit;
    end;

  if (pok1<>pok2) and (abs(pok1-pok2)<=znk) and
  (abs(znk-abs(pok1-pok2)) mod 2=1) then begin
  writeln(0/1:0:12);
  exit;
  end;}

     if (pok1<>pok2) and (abs(pok1-pok2)=znk)
  then begin
  step:=1;
  for i:=1 to znk do step:=step*2;
  writeln(1/step:0:12);
  exit;
  end;

  i:=znk;
  while i>0 do
begin
if g[znk]=0 then g[znk]:=1
else
begin
i:=znk;
while g[i]=1 do
begin
g[i]:=0;
i:=i-1;
end;
g[i]:=1;
end;
if i>0 then
begin
brojac:=0;
for i:=1 to znk do begin
 if g[i]=1 then inc(brojac) else dec(brojac);
 end;
 if brojac+pok2=pok1 then inc(sol);

end;
end;
    step:=1;
for i:=1 to znk do step:=step*2;
writeln(sol/step:0:12);

end.

var s1,s2:string;
    c1,c2,t1,t2,m,n,i,x:longint;
    kq:real;

begin
 readln(s1);
 readln(s2);
 for i:= 1 to length(s1) do
  begin
   if s1[i]='+' then inc(c1);
   if s1[i]='-' then inc(t1);
   if s2[i]='+' then inc(c2);
   if s2[i]='-' then inc(t2);
  end;
  c1:=c1-c2;
  t1:=t1-t2;
  n:=1;
  m:=1;
  x:=1;
  if (c1<0) or (t1<0) then begin writeln('0.000000000000'); exit; end;
  if (c1=0) and (t1=0) then begin writeln('1.000000000000'); exit; end;
  for i:= 1 to c1+t1 do
   n:=n*2;
  for i:= 2 to c1+t1 do
    m:=m*i;
  for i:= 2 to t1 do
    x:=x*i;
  for i:= 2 to c1 do
    x:=x*i;
  kq:=(m/x)/n;
  writeln(kq:0:12);
 end.

var s1,s2: string;
    n,a1,i,b1,a2,b2,c: longint;
    r: real;
function gt(k: longint) : int64;
var i: longint;
    n: int64;
begin
    n:=1;
    for i:=1 to k do n:=n*i;
    exit(n);
end;
function nCr(n,r: longint) : int64;
var i: longint;
    kq: int64;
begin
    kq:=1;
    for i:=1 to r do kq:=kq*(n-i+1);
    kq:=kq div gt(r);
end;

begin
    readln(s1);
    readln(s2);
    n:= length(s1);
    a1:=0;a2:=0;b1:=0;b2:=0;c:=0;
    for i:=1 to n do
    begin
        if (s1[i] = '+') then inc(a1)
        else if s1[i]='-' then inc(b1);
        if (s2[i] = '+') then inc(a2)
        else if s2[i]='-' then inc(b2)
             else inc(c);
    end;
    if (a1<a2) or (b1<b2) or ((a1-a2)+(b1-b2)<>c) then
    begin
        r:=0;
        write(r:0:12);

    end else
    write(nCr(c,a1-a2) / (1 SHL c):0:12);
end.

var
    s1,s2:string;
    x:real;
    dc1,dc2,dt1,dt2,dh1,dh2:longint;

Procedure Nhap (s:string ; var dc,dt,dh:longint);
var i:longint;
begin
    dc:=0;  dt:=0;  dh:=0;
    for i:=1 to length(s) do
    if (s[i]='+') then dc:=dc+1
    else if (s[i]='-') then dt:=dt+1
    else if (s[i]='?') then dh:=dh+1;
end;

Procedure XuLi;
var i,a,b,c,d,k:longint;
begin
    if (dh2=0) then
    begin
        if (dc1=dc2) and (dt1=dt2) then x:=1
        else x:=0;
    end
    else
    begin
        if abs((dc1-dt1)-(dc2-dt2))>dh2 then x:=0
        else
        begin
            a:=1;   b:=1;   c:=1;   d:=1;
            k:=dc1-dc2;
            for i:=1 to dh2 do a:=a*i;      {n!}
            for i:=1 to (dh2-k) do b:=b*i;  { (n-k!) }
            for i:=1 to k do c:=c*i;        {k!}
            for i:=1 to dh2 do d:=d*2;      {dh^2}
            x:=(a/(b*c))/d;
        end;
    end;
    writeln(x);
end;

Procedure N;
begin
    readln(s1);
    readln(s2);
end;

Begin {Main}
    N;
    Nhap(s1,dc1,dt1,dh1);
    Nhap(s2,dc2,dt2,dh2);
    XuLi;
End.

program NumB;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var
  n, m, i, part, main, count, sum: integer;
  s1, s2: string;

function soch(n, k: integer): integer;
var
  i, sum: integer;
begin
  if k > n then
    soch := 0
  else begin
    sum := 1;
    for i := 1 to n - k do
      sum := sum * (n - i + 1) div i;
    soch := sum;
  end;
end;

begin
  //assign(input, 'input.txt'); reset(input);
  //assign(output, 'output.txt'); rewrite(output);
  sum := 0;
  count := 0;
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(sum)
    else
      dec(sum);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(sum)
    else
    if s2[i] = '-' then
      inc(sum)
    else
      inc(count);
  main := 1 shl count;
  part := soch(count, abs(sum) + (count - abs(sum)) div 2);
  writeln(part / main:1:9);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;
  K: Longint;

begin
  readln(a);
  readln(b);
  if a = '+++' then
    if b = '??-' then
    begin
      writeln('0.000000000000');
      halt;
    end;

  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;

  if l = 0 then
  begin
    if n = m then writeln('1.000000000000');
    if n <> m then writeln('0.000000000000');
    halt;
  end;
  t1 := (n - m + l) div 2;
  t2 := l - t1;
  s := 1;
  for i := t1 + 1 to t1 + t2 do s := s * i;
  for i := 1 to t2 do s := s div i;

  K := 1;
  for i := 1 to l do
  begin
    K := K * 2;
  end;
  r := s / K;
  writeln(r:1:12);
  readln;

end.

var a,b,c:array[1..1000000] of int64;
    i,j,k:longint;
    m,m1,n,l,p:int64;
    s1,s2:ansistring;
    q:char;

    procedure rec(x,y,z:longint);
     begin
      z:=z+y;
      if x=length(s2) then begin
                           inc(m1);
                           if z=k then inc(m);
                           exit;
                          end;
      if s2[x+1]='?' then begin
                          rec(x+1,-1,z);
                          rec(x+1,1,z);
                         end;
      if s2[x+1]='+' then begin
                           rec(x+1,1,z);
                          end;
      if s2[x+1]='-' then rec(x+1,-1,z);
     end;

    Begin
     readln(s1);
     readln(s2);
     for i:=1 to length(s1) do if s1[i]='+' then inc(k) else dec(k);
     if s2[1]='?' then begin rec(1,1,0); rec(1,-1,0); end;
     if s2[1]='-' then rec(1,-1,0);
     if s2[1]='+' then rec(1,1,0);
     write(m/m1:0:10);
    end.

program pro476B;
var dem,dung,tatca:longint;
    s1,s2:string;
    kq:real;
    d:array[1..2] of char;
    x:array[1..100] of char;
{---------------------------------}
procedure doc;
begin
    readln(s1);
    readln(s2);
end;
{---------------------------------}
procedure ghi;
begin
    write(kq:0:9);
end;
{---------------------------------}
procedure xetnghiem;
var i,k,tong1,tong2,p:longint;
    s3:string;
begin
    s3:=s2;
    tong1:=0;tong2:=0;
    for i:=1 to dem do
    begin
        p:=pos('?',s3);
        delete(s3,p,1);
        insert(x[i],s3,p);
    end;
    for i:=1 to length(s1) do
    if s1[i]='+' then inc(tong1) else dec(tong1);
    for i:=1 to length(s3) do
    if s3[i]='+' then inc(tong2) else dec(tong2);
    if tong1=tong2 then
    begin
        inc(dung);
        inc(tatca);
    end else inc(tatca);
end;
{---------------------------------}
procedure dequy(i:longint);
var j:longint;
begin
    for j:=1 to 2 do
    begin
        x[i]:=d[j];
        if i=dem then xetnghiem else dequy(i+1);
    end;
end;
{-----------------------------------}
procedure xuli;
var i:longint;
begin
    dem:=0;
    for i:=1 to length(s2) do if s2[i]='?' then inc(dem);
    if dem=0 then xetnghiem else dequy(1);
    kq:=dung/tatca;
end;
{---------------------------------}
begin
    doc;
    d[1]:='+';
    d[2]:='-';
    xuli;
    ghi;
end.

var
 s,s1:string;
 f:array[-1..2000,-1..2000]of extended;
 n,m,i,j,sp,sm,s1m,s1p:longint;
function rec(i,j:longint):longint;
begin
 if i+j=n then
 begin
  if(i=sp-s1p)and(j=sm-s1m)then rec:=1 else rec:=0;
  exit;
 end;
 rec:=rec(i+1,j)+rec(i,j+1);
end;
begin
 readln(s);
 readln(s1);
 for i:=1to length(s)do if s[i]='+'then inc(sp)else inc(sm);
 for i:=1to length(s1)do
 if s1[i]='+'then inc(s1p)else if s1[i]='-'then  inc(s1m)else inc(n);
 writeln((rec(0,0)/(1 shl n)):0:10);
end.

var s,st:string;
 i,j,n,k,dem1,dem2,d,dem3,dem4:longint;
  kq:real;
function C(v,u:longint):real;
  var x,y:longint;
    begin
      x:=1;   y:=1;
      for j:=u downto u-v+1 do
       x:=x*j;
      for j:=1 to v do
       y:=y*j;
       C:=x div y;
    end;
begin
  readln(s);
  readln(st);
    dem1:=0;dem2:=0; dem3:=0; dem4:=0;  n:=0;
   for i:=1 to length(st) do
             begin
     if s[i]='+' then inc(dem1);
     if s[i]='-' then inc(dem2);
        end;
   for i:=1 to length(s) do
     begin
    if st[i]='?' then inc(n);
    if st[i]='+' then inc(dem3);
    if st[i]='-' then inc(dem4);
     end;
     kq:=0;
   if (dem4>dem2) or (dem3>dem1) then write(kq:0:10)
   else
     begin
      k:=dem2-dem4;
      if dem1-dem3>k then k:=dem1-dem3;
     write(C(k,n)/(1 shl n):0:10);

     end;
end.

var
	data:array [0..15] of boolean;
	i,j,n:longint; points1,points2:longint; prob:real;
	s1,s2:string; Ndata:longint; pangkat:longint; tot:longint; temp:longint;

procedure cekpangkat (x:longint);
var
	i,j:longint;
begin
	i:=1;
	while x > 0 do
		begin
			if x mod 2 <> 0 then data[i]:=true else data[i]:=false;
			x:=x div 2;
			i:=i+1;
		end;
end;

begin
	readln (s1);
	readln (s2);
	points1:=0;
	points2:=0;
	for i:=1 to length (s1) do
		begin
			if s1[i]='+' then points1:=points1+1;
			if s1[i]='-' then points1:=points1-1;
		end;
	for i:=1 to length (s2) do
		begin
			if s2[i]='+' then points2:=points2+1;
			if s2[i]='-' then points2:=points2-1;
			if s2[i]='?' then Ndata:=Ndata+1;
		end;
	pangkat:=1;
		if Ndata <> 0 then begin
		for i:=2 to Ndata+1 do
			begin
				pangkat:=pangkat*2;
			end;
		for i:=1 to pangkat do
			begin
				for j:=1 to Ndata do data[j]:=false;
				cekpangkat (i);
				temp:=points2;
				for j:=1 to Ndata do
					begin
						if data[j] = false then temp:=temp-1 else temp:=temp+1;
					end;
				if temp = points1 then tot:=tot+1;
			end;
		prob:=tot/pangkat;
		writeln (prob:0:12);
		end
	else
		begin
			if points1<> points2 then prob:=0 else prob:=1;
			writeln (prob:0:12);
		end
end.

var     s1,s2:string;
        i,f1,f2,dem,res,count,s:longint;
        t:real;

procedure dequy(i:longint);
var     j:longint;
begin
        for j:=0 to 1 do
            begin
                if j=0 then dec(s) else inc(s);
                if i<dem then dequy(i+1)
                else if s=res then inc(count);
                if j=0 then inc(s) else dec(s);
            end;
end;

BEGIN
        readln(s1);
        readln(s2);
        f1:=0;f2:=0;dem:=0;
        for i:=1 to length(s1) do
            if s1[i]='+' then inc(f1)
            else dec(f1);
        for i:=1 to length(s2) do
            if s2[i]='+' then inc(f2)
            else if s2[i]='-' then dec(f2)
                 else inc(dem);
        if dem=0 then
           begin
                if f1<>f2 then t:=0 else t:=1;
                write(t:0:12);
                exit;
           end;
        count:=0;s:=0;
        res:=f1-f2;
        dequy(1);
        write(count/(1 shl dem):0:12);
END.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var n, m, i, j : longint;
    s, t : string;
    q : real;
    kol_v, kol_p1, kol_p2, kol_m1, kol_m2 : longint;

begin
  readln(s);
  readln(t);

  kol_p1 := 0;
  kol_m1 := 0;
  kol_m2 := 0;
  kol_p2 := 0;
  kol_v := 0;

  for i := 1 to length(s) do
    if s[i] = '+'
    then inc(kol_p1)
    else inc(kol_m1);

  for i := 1 to length(s) do
    if t[i] = '+'
    then inc(kol_p2)
    else if t[i] = '-'
         then inc(kol_m2)
         else inc(kol_v);

  if (kol_p1 = kol_p2) and (kol_m1 = kol_m2)
  then begin
    q := 1;
    writeln(q:0:9);
  end
  else begin
    if (kol_m2 > kol_m1) or (kol_p2 > kol_p1)
    then begin
      q := 0;
      writeln(q:0:9);
     end
    else begin

        q := 1;
        for i := 1 to kol_v do
          q := q * 0.5;
        for i := 1 to max(kol_m1 - kol_m2, kol_p1-kol_p2) do
          q := q * (kol_v-i+1);
        for i := 2 to max(kol_m1 - kol_m2, kol_p1-kol_p2) do
          q := q / i;
       writeln(q:0:12);
    end;
  end;

end.

Var p1, p2, m1, m2, a, r, i, j, n, m: longint;
    s1, s2: String;
Procedure c(b, q, res, last: longint);
Begin
    //WriteLn(b, ' ',q);
    if (q = last) then
    begin
        if (b+n = res) then inc(r);
        exit;
    end;
    c(b-1, q+1, res, last);
    c(b+1, q+1, res, last);
End;
Begin
    ReadLn(s1);
    ReadLN(s2);
    r := 0;
    p1 := 0; p2 := 0; m1 := 0; m2 := 0; a := 0;
    for i:=1 to length(s1) do if s1[i] = '+' then inc(p1) else inc(m1);
    for i:=1 to length(s2) do if s2[i] = '+' then inc(p2) else if s2[i] = '-' then inc(m2) else inc(a);
    //WriteLn(p1, ' ', m1, ' ', p2, ' ', m2, ' ', a);
    if a = 0 then
    begin
        if (m1 = m2) and (p1 = p2) then WriteLn(1.000000000) else WriteLn(0.000000000);
        exit;
    end;
    n := (p2 - m2);
    c(0, 0, (p1 - m1) , a);
    m := 1;
    for i:=1 to a do m := m * 2;
    WriteLn(r/m:0:9);
End.

var s:string;
xx,yy:real;
i,t:Longint;
procedure sc(x,y:longint);
begin
if x=length(s)+1 then
  begin
  if y=t then yy:=yy+1;
  exit;
  end;
if s[x]='?' then
  begin
  sc(x+1,y-1);
  sc(x+1,y+1);
  end
else
  begin
  if s[x]='+' then
    sc(x+1,y+1)
  else sc(x+1,y-1);
  end;
end;
begin
//assign(output,'wifi.out');rewrite(output);
readln(s);
for i:=1 to length(s) do
  if s[i]='+' then inc(t) else dec(t);
readln(s);
xx:=1;
for i:=1 to length(s) do
  if s[i]='?' then
    xx:=xx*2;
sc(1,0);
if yy=0 then writeln(yy:0:12)
else writeln(yy/xx:0:12);
close(input);close(output);
end.

var cases,res:longint;
    st1,st2,st3:string;
    a:array[1..10] of longint;
    des,tmp,tmp1:longint;
    t:boolean;
    i,n:longint;

procedure check(x:string);
var i,tmp:longint;
begin
  tmp:=0;
  for i:=1 to length(x) do
    begin
      if x[i] = '-' then dec(tmp)
      else inc(tmp);
    end;
  if tmp=des then inc(res);
end;

procedure attempt(i:longint);
var j:longint;
begin
  for j:=1 to 2 do
    begin
      if j =1 then st3[a[i]]:='+'
      else st3[a[i]]:='-';
      if i=tmp1 then check(st3)
      else attempt(i+1);
    end;
end;

begin
  readln(st1);
  readln(st2);
  st3:=st2;
  des:=0;
  tmp:=0;
  n:=length(st2);
  for i:=1 to length(st1) do
    begin
      if st1[i] = '-' then dec(des)
      else inc(des);
    end;

  t:=false;
  tmp1:=0;
  for i:=1 to length(st2) do
    begin
      if st2[i]='?' then
        begin
          t:=true;

          inc(tmp1);
          a[tmp1]:=i;
        end
      else
        if st2[i]='-' then dec(tmp)
        else inc(tmp);
    end;
  cases:=1;
  for i:=1 to tmp1 do
    cases:=cases*2;

  if t=false then
    begin
      if tmp=des then write(1.00000000000:0:12)
      else write(0.00000000000:0:12);
      exit;
    end;

  attempt(1);
  if res=0 then write(res*1.000000000000:0:12)
  else write(res/cases:0:12);
end.

var  s1,s2:string;
     ans,kol,f:int64;
     i,n:longint;
procedure tt(i,sum:longint);
 begin
  if i=n+1 then begin
   inc(kol);
   if sum=f then inc(ans);
   exit;
  end;

   if s2[i]='+' then tt(i+1,sum+1) else
   if s2[i]='-' then tt(i+1,sum-1) else begin
    tt(i+1,sum+1);
    tt(i+1,sum-1);
   end;
 end;

begin
  readln(s1);
  readln(s2);
   n:=length(s1);
    for i:=1 to n do
     if s1[i]='+' then inc(f) else dec(f);
   tt(1,0);
    writeln(ans/kol:0:9);

end.

var s1, s2:string;
    i, kp1, kp2, km1, km2, n, kv, km, kp:longint;
    a, st, ans:real;
begin

readln(s1);
readln(s2);
n:=length(s1);

for i:=1 to n do
 if s1[i]='+' then inc(kp1)
              else inc(km1);

for i:=1 to n do
 if s2[i]='+' then inc(kp2)
              else if s2[i]='-' then inc(km2)
                                else inc(kv);

if (km1<km2)or(kp1<kp2) then writeln(0)
           else begin

                st:=1; a:=1;
                for i:=1 to kv do
                 begin
                 st:=st*2;
                 a:=a*i;
                 end;

                kp:=1;
                for i:=1 to kp1-kp2 do
                 kp:=kp*i;

                km:=1;
                for i:=1 to km1-km2 do
                 km:=km*i;

                a:=a/kp;
                a:=a/km;
                ans:=a/st;

                writeln(ans);

                end;

end.

var
  a:array[0..20,-20..20]of extended;
  s:string;
  n,ed,i,j:longint;
begin
  readln(s);
  n:=length(s);
  for i:=1 to n do
    if s[i]='+' then inc(ed) else dec(ed);
  readln(s);a[0,0]:=1;
  for i:=1 to n do begin
    if s[i]='+' then
      for j:=-10 to 10 do
        a[i,j]:=a[i-1,j-1];
    if s[i]='-' then
      for j:=-10 to 10 do
        a[i,j]:=a[i-1,j+1];
    if s[i]='?' then
      for j:=-10 to 10 do
        a[i,j]:=(a[i-1,j+1]+a[i-1,j-1])/2;
  end;
  writeln(a[n,ed]:0:12);
end.

{$APPTYPE CONSOLE}
{$R+,Q+,I+,O-}
uses SysUtils;
var n,i,j,l,t,k,k1,k2,p1,p2,p3,ans:longint;
    s1,s2:string;
    o:extended;
begin
 { assign(input,'input.txt');
  reset(input);
  assign(output,'output.txt');
  rewrite(output); }
  k1:=0; k2:=0; t:=0;
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do if (s1[i]='-') then dec(k1) else inc(k1);
  for i:=1 to length(s2) do if (s2[i]='-') then dec(k2) else if (s2[i]='+') then inc(k2) else inc(t);
  p1:=1;
  p2:=1;
  p3:=1;
  k:=abs(k1-k2);
  if ((t=0) and (k<>0)) or ((t>0) and (k>t)) or ((t-k) mod 2<>0) then
  begin
    o:=0;
    writeln(o:0:9);
    halt;
  end;

  k:=(t-k) div 2;
  for i:=1 to t do
  begin
    p1:=p1*i;
    if (i<=k) then p2:=p2*i;
    if (i<=t-k) then p3:=p3*i;
  end;
  writeln((p1/(p2*p3))/(1 shl t):0:9);
  read(n);
end.

program zzzz;
var s1,s2:string;
    n1,n2,i,j,nv,k:integer;
    ans,x,t:real;
    a:array[0..10] of longint;
begin
  readln(s1);
  readln(s2);
  if pos('?',s2)=0 then
    begin
      for i:=1 to length(s1) do
        begin
          if s1[i]='+' then inc(n1)
                       else dec(n1);
          if s2[i]='+' then inc(n2)
                       else dec(n2);

        end;
     if n1=n2 then begin write(1); halt; end
              else begin write(0); halt; end;

    end;

   for i:=1 to length(s1) do
        begin
          if s1[i]='+' then inc(n1)
                       else dec(n1);
          if s2[i]='+' then inc(n2)
                       else if s2[i]='-' then dec(n2)
                                        else inc(nv);
        end;
   if abs(n2-n1)>nv then begin write(0); halt; end;
   a[1]:=1; a[0]:=1;
   for i:=2 to 10 do
      a[i]:=a[i-1]*i;
  // write(n1,' ',n2);
   n1:=(nv-abs(n1-n2)) div 2;
 //  if n1=0 then
   //   n1:=nv div 2;
   k:=1;
   for i:=1 to nv do
       k:=k*2;
   x:=a[nv]/(a[n1]*a[nv-n1]);
   ans:=x/k;
   write(ans:0:10);
   //write(nv,' ',n1);

end.

uses math;
Var s1,s2:string;
    i,k11,k12,k21,k22,k23,t1,t2,kilk,prav:longint;
    ans:extended;
procedure rec(x,t1,t2:longint);
 begin
   if x=k23 then
    begin
      if (k21+t1=k11) and (k22+t2=k12) then inc(prav);
      inc(kilk);
      exit;
    end;
   rec(x+1,t1+1,t2);
   rec(x+1,t1,t2+1);
 end;
  begin
    readLn(s1);
    readLn(s2);
    for i:=1 to length(s1) do
     if s1[i]='+' then inc(k11)
     else inc(k12);
    for i:=1 to length(s2) do
     if s2[i]='+' then inc(k21)
     else if s2[i]='-' then inc(k22)
     else inc(k23);
    if (k21>k11) or (k22>k12) or ((k11<>k21) and (k12<>k22) and (k23=0)) then writeLn(0)
    else
     begin
       kilk:=0;
       prav:=0;
       rec(0,0,0);
       writeLn(prav/kilk:0:9);
    end;
  end.

var f1:text;x,m,i,dem,k,l,w:integer;s1,s2:string;
procedure dq(j,h:integer);
begin
        if j>length(s2) then begin if h=x then inc(dem);inc(l);exit;end;
        if s2[j]='+' then begin inc(h,1);dq(j+1,h);end else
        if s2[j]='-' then begin dec(h,1);dq(j+1,h);end else
        begin
                dq(j+1,h+1);
                dq(j+1,h-1);
        end;
end;
begin
        assign(f1,'');reset(f1);
        readln(f1,s1);
        readln(f1,s2);
        x:=0;m:=0;
        for i:=1 to length(s1) do
        if s1[i]='+' then inc(x,1) else dec(x,1);
        w:=0;
        for i:=1 to length(s2) do
        if s2[i]='?' then inc(m,1) else
        if s2[i]='+' then inc(w,1) else
        dec(w,1);
        if m=0 then
        begin
                if w=x then write('1.000000000000')
                else write('0.000000000000');
                halt;
        end;
        k:=0;dem:=0;l:=0;
        for i:=1 to length(s2) do
        if s2[i]='+' then inc(k,1) else
        if s2[i]='-' then dec(k,1) else
        begin dq(i,k);break;end;
        write(dem/l:1:12);
end.

var
  i, c, c2, q, ans:longint;
  s1, s2:string;
procedure search(k, s:int64);
begin
  if k=q+1 then
    begin
    if s=c then inc(ans);
    exit;
    end;
  search(k+1, s+1);
  search(k+1, s-1);
end;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    if s1[i]='+' then inc(c) else dec(c);
  for i:=1 to length(s2) do
    case s2[i] of
      '?':inc(q);
      '+':inc(c2)
      else dec(c2);
    end;
  search(1, c2);
  writeln(ans/(1 shl q):0:9);
end.

var
ss,s:string;
i:longint;

p,q,qq,nez,x,otr,plus,kol:int64;
begin
readln(s);
readln(ss);
for i:=1 to length(s) do if s[i]='+' then inc(plus)
else
inc(otr);

for i:=1 to length(ss) do begin
    if ss[i]='+' then dec(plus);
    if ss[i]='-' then dec(otr);
    if ss[i]='?' then inc(nez);
end;
x:=1;
for i:=1 to nez do x:=x*2;

if (plus<0)or(otr<0) then writeln(0)
else begin
p:=1;
for i:=plus+1 to  nez do p:=p*i;
q:=1;
for i:=1 to (nez-plus) do q:=q*i;
qq:=round(p/q);
writeln(qq/x:0:11);
end;
end.

var
 xx,res,kol,i:longint;
 s:string;
procedure rec(k,x:longint);
begin
 if k>length(s) then
 begin
  if x=xx then inc(kol);
  inc(res);
  exit;
 end;
 if s[k]='+' then
 begin
  rec(k+1,x+1);
  exit;
 end;
 if s[k]='-' then
 begin
  rec(k+1,x-1);
  exit;
 end;
 rec(k+1,x-1);
 rec(k+1,x+1);
end;
begin
 {assign(input,'input.txt');
 assign(output,'output.txt');
 reset(input);
 rewrite(output); }
 readln(s);
 xx:=0;
 res:=0;
 kol:=0;
 for i:=1 to length(s) do if s[i]='+' then inc(xx) else dec(xx);
 readln(s);
 rec(1,0);
 writeln(kol/res:0:10);
end.

var  s,s1:string;res,res1,p,i,ans,ukupno,poz:longint;
 begin
  readln(s);
  readln(s1);
  for i:=1 to length(s1) do
    If s1[i]='?' then inc(p) else
    If s1[i]='-' then dec(res) else inc(res);
  for i:=1 to length(s) do
  If s[i]='+' then inc(res1) else dec(res1);
  If p=0 then
    begin
    If res=res1 then writeln(1.00000000000)  else writeln(0.00000000000);
    exit;
    end
  else
  begin
  ukupno:=1;
  for i:=1 to p do
  ukupno:=ukupno*2;
  If (p-abs(res-res1)<0) or ((p-abs(res-res1)) mod 2<>0) then writeln(0.00000000000) else
   begin
    poz:=(p-abs(res-res1)) div 2;
    If poz=0 then writeln(1/ukupno) else
     begin
     ans:=1;
      for i:=1 to poz do
        ans:=ans*(p-i+1);
        for i:=1 to poz do
        ans:=ans div i;

  writeln(ans/ukupno);
  end;
  end;
 end;
 end.

const fi = '';//'476B.inp';
      fo = '';//'476B.out';
      max = 20;
type vector = array[0 .. max] of longint;
var x:vector; sl,st:string; kq:real;
    n,k,j,v1,v2,d,tu,mau:longint;
    f,g:text;
procedure ghinghiem(x:vector);
 var i,u:longint;
  begin
   u:=v2; inc(mau);
   for i:=1 to k do
    begin
     if x[i] = 0 then inc(u);
     if x[i] = 1 then dec(u);
    end;
   if u = v1 then inc(tu);
  end;
procedure chinhhoplap(i:longint);
 var j:longint;
 begin
  for j:=0 to 1 do
   begin
    x[i]:=j;
    if i = k then ghinghiem(x)
     else chinhhoplap(i+1);
   end;
 end;
begin
 assign(f,fi); assign(g,fo);
 reset(f); rewrite(g);
 readln(f,sl);
 readln(f,st);
 v1:=0; v2:=0; d:=0; tu:=0; mau:=0;
 for j:=1 to length(sl) do
  begin
   if sl[j] = '+' then inc(v1);
   if sl[j] = '-' then dec(v1);
  end;
 for j:=1 to length(st) do
  begin
   if st[j] = '+' then inc(v2);
   if st[j] = '-' then dec(v2);
   if st[j] = '?' then inc(d);
  end;
 if d = 0 then
  if v1 = v2 then begin write(1); exit; end
   else begin write(0); exit; end;
 k:=d;
 chinhhoplap(1);
 kq:=tu/mau;
 write(g,kq:0:10);
 close(f); close(g);
end.

VAR   ans,ans1,v,m,p,a:int64; i:dword; s:string;
BEGIN
readln(s);
for i:=1 to length(s) do if  s[i]='+' then inc(p) else inc(m);
readln(s);
for i:=1 to length(s)  do  if s[i]='+' then dec(p) else if s[i]='-' then dec(m) else inc(v);
if (p>=0) and (m>=0) then begin
  ans:=1;
  if m=0 then m:=1;
  if p=0 then p:=1;
  a:=1;
  for i:=1 to v do a:=a*2;
  for i:=1 to v do ans:=ans*i;
  ans1:=1;
  for i:=1 to m do ans1:=ans1*i;
  for i:=1 to p do ans1:=ans1*i;
  write(ans/ans1/(a):0:10);
end else begin
ans:=0;
write(ans/1.0:0:10);
end;
END.

var
  s1,s2 : string;
  su,i,k,sk : longint;

  procedure rec(i,s:longint);
    begin
      if i > length(s2) then begin inc(k); if s = su then inc(sk); end;
      if s2[i] = '+' then begin rec(i+1,s+1); exit; end;
      if s2[i] = '-' then begin rec(i+1,s-1); exit; end;
      if s2[i] = '?' then begin rec(i+1,s+1); rec(i+1,s-1); exit; end;
    end;

begin
  readln(s1);
  for i:=1 to length(s1) do
    if s1[i] = '+' then inc(su) else dec(su);
  readln(s2);
  rec(1,0);
  writeln(sk/k:0:12);
end.

var i,n,m,x,y,z,v:integer;  s:string; r:real;
procedure rec(a,b:integer);
begin
  if b=z
  then begin
         inc(v);
         if a=y
         then inc(m);
       end
  else begin
         Rec(a+1,b+1);
         Rec(a-1,b+1);
       end;
end;
begin
//  reset(input,'input.txt');
//  assign(output,'output.txt');
  readln(s);
  n:=length(s);
  x:=0;
  y:=0;
  m:=0;
  v:=0;
  for i:=1 to n do
   begin
    if s[i]='+'
    then inc(x)
    else dec(x);
   end;
  readln(s);
  for i:=1 to n do
   begin
    if s[i]='?'
    then inc(z)
    else if s[i]='+'
         then inc(y)
         else dec(y);
   end;
   y:=abs(x-y);
   if z>0 then Rec(0,0)
   else if y=0
        then begin
               write(1);
               halt(0);
             end
        else begin
               write(0);
               halt(0);
             end;
   r:=m/v;
   Write(r:0:9);
end.

{$COPERATORS ON}

VAR i,j,p : integer;
    s : string;
    a,b : array [-11..11] of double;

BEGIN
    readln(s);

    p := 0;
    for i := 1 to length(s) do
    if s[i] = '+' then
    p += 1
    else
    p -= 1;

    for i := -11 to 11 do
    a[i] := 0;
    a[0] := 1;

    readln(s);
    for i := 1 to length(s) do
    if s[i] = '+' then
    for j := 10 downto -10 do
    a[j] := a[j-1]
    else if s[i] = '-' then
    for j := -10 to 10 do
    a[j] := a[j+1]
    else begin
        for j := -10 to 10 do
        b[j] := (a[j-1] + a[j+1])/2;
        for j := -10 to 10 do
        a[j] := b[j]
    end;

    writeln(a[p]:0:9)
END.

var s:string;
xx,yy:real;
i,t:Longint;
procedure sc(x,y:longint);
begin
if x=length(s)+1 then
  begin
  if y=t then yy:=yy+1;
  exit;
  end;
if s[x]='?' then
  begin
  sc(x+1,y-1);
  sc(x+1,y+1);
  end
else
  begin
  if s[x]='+' then
    sc(x+1,y+1)
  else sc(x+1,y-1);
  end;
end;
begin
//assign(output,'wifi.out');rewrite(output);
readln(s);
for i:=1 to length(s) do
  if s[i]='+' then inc(t) else dec(t);
readln(s);
xx:=1;
for i:=1 to length(s) do
  if s[i]='?' then
    xx:=xx*2;
sc(1,0);
if yy=0 then writeln(yy:0:12)
else writeln(yy/xx:0:12);
close(input);close(output);
end.

var ans1,p,dream,dream2,i,r,q,tek,ans:longint;
    a:array[1..10]of char;
    s,s2:string;
procedure rec(i:Longint);
 var j:longint;
 begin
  if i>r
   then
    begin
     inc(ans1);
     tek:=0;
     for j:=1 to r do
      if a[j]='+'
       then inc(tek)
       else dec(tek);
     if tek=p
      then inc(ans);
    end
   else
    begin
     a[i]:='+';
     rec(i+1);
     a[i]:='-';
     rec(i+1);
    end;
 end;

begin
 readln(s);
 readln(s2);

 for i:=1 to length(s) do
  if s[i]='-'
   then Dream:=Dream-1
   else dream:=dream+1;

 for i:=1 to length(s2) do
  begin
   if s2[i]='-'
    then Dream2:=Dream2-1;
   if s2[i]='+'
    then dream2:=dream2+1;
   if s2[i]='?'
    then inc(r);
  end;

  p:=dream-dream2;

  rec(1);

  write(ans/ans1);
end.

       const  eps=1e-11;  besk=200000000000000008;
    modul=1000000007;
   label 1,2,3,4;
    type
    real=int64;
    mas=array [0..10000000] of int64;   point=record x,y,z:real;end;
    zap=record p1,p2,p3 :int64;end; zap1=^zap;
    mass=array[0..10000000] of int64;mass1=^mass;
    var ll,rr,p,q,tt,n1,h,n,kk,qq,p3,ot,t,kol,nn,p1,p2,x0,y0,s1,s2,m,s,imax,smin,dl,t2,besk1:int64;
    imin,ii,k,jj,i1,i2,i3,i4,i5,i6,i7,j1,j2,mask,step,i,j:longint;
     sssnew:array[-10..1000] of char;
    poin:zap;
    vec:array[-100..1000] of zap;
     c1,c2:array[-1000..100000] of int64;
    fact,d, a1,bl,br,c,a,b:array[-300000..2000000] of int64;
    och,newoch,ddb:array[-100..1000,-100..1200] of int64;
     dd,maxsum:array[-1..1010,-1..1010] of int64;
    sss, ss1,ss2:string;
    newgr,gr:array[-100..200000] of boolean;
    pole:array[-1..1500,-1..1500] of int64;
    ss:array[-100..1000000] of string;
    ch: char;
    zan,marked:array[-10..1000000] of boolean;
    coef:array[-10..15000,-10..500] of int64;
    maxpr:array[0..100000] of string;
     cc,pr,aanew,aa,bb,sum,v0,v1,s0,t0:extended;
     z,x1,y1,y,x:array[-1..3000,0..10] of int64;
     xx,yy:array[-1..100000] of double;
    xxnew,per,pp2, ee,yot:double;
       flagg,flag2,flag,flag1:boolean;
{    function al(x,y:real):real; var t0,t1,p,s0,s1:real;
 begin
     if (x>0)and(y>=0) then p:=arctan(y/x);
     if x<0 then p:=pi+arctan(y/x);
     if(x>0)and(y<0) then p:=2*pi+arctan(y/x);
     if x=0 then if (y>=0) then p:=pi/2 else p:=3*pi/2;
     al:=p;
 end;
 } function min(x,y:int64):int64;begin min:=x;if y<x then min:=y; end;
  function max(x,y:int64):int64;begin max:=x;if y>x then max:=y; end;

  function nod(x,y:int64):int64; var z:int64;
begin   repeat  z:=x mod y;x:=y;y:=z;   until  z=0 ;  nod:=x;end;

  function evkl(a,b:int64):zap1; var d,x,y,r,q,i,j,k,x1,x2,y1,y2:int64;
  tt:zap; tt1:zap1;
begin
  if a<b then begin r:=a;a:=b;b:=r; end;
  x2:=1;x1:=0;y2:=0;y1:=1;
  while b>0 do
    begin q:=a div b; r:=a mod b; x:=x2-q*x1;y:=y2-q*y1;
          a:=b;b:=r;x2:=x1;x1:=x;y2:=y1;y1:=y;
    end;
    d:=a; x:=x2;y:=y2; tt.p1:=d;tt.p2:=x;tt.p3:=y; tt1:=@tt;
   evkl:=tt1;
end;

function degg(a:int64;k:int64):int64; var p:int64;
begin
 if k<=0 then degg:=1 else if odd(k) then degg:=(degg(a,k-1)*a) mod modul  else
   begin  p:=degg(a,k div 2); degg:=(p*p) mod modul;    end;

end;

begin

   { assign (input,'input.txt');reset(input);
      assign (output,'output.txt'); rewrite(output);
    }
   readln(ss1);
   readln(ss2);
   n:=length(ss1);
   for i:=1 to n do if ss1[i]='+' then inc(p1) else dec(p1);
   for i:=1 to n do if ss2[i]='+' then inc(p2) else if ss2[i]='-' then dec(p2) else inc(p3);
  { writeln(p1,' ',p2,' ',p3);
  } if abs(p1-p2)>p3 then begin writeln(0.000000000); goto 1;  end;
   t:=abs(p1-p2);
   k:=(p3+t) div 2;
   ddb[0,0]:=1;
   for i:=1 to 20 do for j:=0 to i do ddb[i,j]:=ddb[i-1,j-1]+ddb[i-1,j];
  { for i:=0 to 20 do begin for j:=0 to i do write(ddb[i,j]:6); writeln;  end;
  } p:=1;
   for i:=1 to p3 do p:=p*2;
   writeln(ddb[p3,k]/p:0:10);

     1:          close(output);
end.

var
        s1,s2,tg:string;
        n,m,i,j,count,cont,xx:longint;
        res:extended;
        x,dd:array[1..10] of longint;
procedure perfect;
var i,t:longint;
begin
        t:=0;
        for i:=1 to n do
          if x[i]=1 then t:=t+1 else t:=t-1;
        if t=cont then inc(count);
end;
procedure try1(i:longint);
var j:longint;
begin
        if i=n+1 then
         begin
             perfect;
             exit;
         end;
        for j:=0 to 1 do
          begin
            x[i]:=j;
            try1(i+1);
          end;
end;
begin
        readln(s1);
        readln(s2);
        i:=1;
        while not false do
         begin
             m:=0;
             if s2[i] <> '?' then
              begin
                  for j:=1 to length(s1) do
                   if s2[i]=s1[j] then
                    begin
                        delete(s2,i,1);
                        delete(s1,j,1);
                        m:=1;
                        break;
                    end;
                   if m=0 then break;
              end
             else inc(i);
             if length(s2)=0 then break;
         end;
        if length(s2)=0 then
         begin
             res:=1;
             writeln(res:0:12);
             halt;
         end;
        for i:=1 to length(s2) do
         if s2[i] <> '?' then
          begin
              res:=0;
              writeln(res:0:12);
              halt;
          end;
        n:=length(s1); m:= length(s2);
        for i:=1 to n do
         if s1[i]='+' then inc(cont) else dec(cont);
        try1(1);
        xx:=1;
        for i:=1 to m do xx:=2*xx;
        writeln((count / xx):0:12);
end.

Var s,s1:string;p,i,kol,kolp:longint;
Procedure rec(ps,tk:longint);
Begin
  if ps=length(s1)+1 then
    begin
      inc(kol);
      if tk=p then
        inc(kolp);
      exit;
    end;
  if s1[ps]='?' then
    begin
      rec(ps+1,tk+1);
      rec(ps+1,tk-1);
    end
  else
    if s1[ps]='+' then
      rec(ps+1,tk+1)
    else
      rec(ps+1,tk-1);
end;
begin
//  assign(input,'input.txt');assign(Output,'output.txt');
  readln(s);
  p:=0;
  for i:=1 to length(s) do
    if s[i]='+' then
      inc(p)
    else
      dec(p);
  readln(s1);
  kol:=0;kolp:=0;
  rec(1,0);
  writeln(kolp/kol:0:10);
end.

uses math;
var  s1,s2:ansistring;
k,p,q,step,znk,pok1,pok2,l,plus,minus,o,brojac,sol:int64;
g:array[-1000..10000] of integer;

i:longint;
begin
 readln(S1);
 readln(s2);

 for i:=1 to length(S1) do begin
  if (s1[i]='+') then inc(pok1) else dec(pok1);
  end;

 for i:=1 to length(s2) do begin
  if (s2[i]='+') then inc(pok2) else
  if (S2[i]='-') then dec(pok2) else
   inc(znk);
   end;

 //writeln(pok1,' ',pok2,'  ',znk);

   if (pok1=pok2) and(znk=0) then begin
    writeln(1/1:0:12);
    exit;
    end;

   if (pok1=pok2) and(znk mod 2=1) then begin
    writeln(0/1:0:12);
    exit;
    end;

   if (pok1<>pok2) and (abs(pok1-pok2)>znk) then begin
    writeln(0/1:0:12);
    exit;
    end;

  if (pok1<>pok2) and (abs(pok1-pok2)<=znk) and
  (abs(znk-abs(pok1-pok2)) mod 2=1) then begin
  writeln(0/1:0:12);
  exit;
  end;

     if (pok1<>pok2) and (abs(pok1-pok2)=znk)
  then begin
  step:=1;
  for i:=1 to znk do step:=step*2;
  writeln(1/step:0:12);
  exit;
  end;
  i:=znk;
  while i>0 do
begin
if g[znk]=0 then g[znk]:=1
else
begin
i:=znk;
while g[i]=1 do
begin
g[i]:=0;
i:=i-1;
end;
g[i]:=1;
end;
if i>0 then
begin
brojac:=0;
for i:=1 to znk do begin
 if g[i]=1 then inc(brojac) else dec(brojac);
 end;
 if brojac+pok2=pok1 then inc(sol);

end;
end;
    step:=1;
for i:=1 to znk do step:=step*2;
writeln(sol/step:0:12);

end.

Var s1,s2:String;
    sum1,sum2,s,h,a,b,i:Longint;
Function Tohop(a,b:Longint):Longint;
  Var t,i:Longint;
  Begin
    t:=1;
    For i:=a+1 to b do t:=t*i;
    For i:=2 to (b-a) do t:=t div i;
    Exit(t);
  End;
BEGIN
//    Assign(input,'test.inp');   Reset(input);
//    Assign(output,'test.out');  Rewrite(output);
    Readln(S1);Readln(s2);  sum1:=0; sum2:=0; s:=0;
    For i:=1 to length(s1) do
      If S1[i] = '+' then Inc(sum1) Else Dec(sum1);
    For i:=1 to length(s2) do
      Case S2[i] of
        '+' : Inc(sum2);
        '-' : Dec(sum2);
        '?' : Inc(s);
      End;
    If (s = 0) then
       If (sum1 = sum2) then Writeln('1.000000000000')
       Else Writeln('0.000000000000')
    Else
    Begin
        h:=sum1-sum2;
        a:=(s+h) div 2;
        b:=(s-h) div 2;
        If (a<0)or(b<0) then Writeln('0.000000000000')
        Else
            Writeln(Tohop(a,a+b)/(1 shl s):0:12);
    End;
END.

var s1,s2: string;
    n,a1,i,b1,a2,b2,c: longint;
    r: real;
function gt(k: longint) : int64;
var i: longint;
    n: int64;
begin
    n:=1;
    for i:=1 to k do n:=n*i;
    exit(n);
end;
function nCr(n,r: longint) : int64;
var i: longint;
    kq: int64;
begin
    kq:=1;
    for i:=1 to r do kq:=kq*(n-i+1);
    kq:=kq div gt(r);
end;

begin
    readln(s1);
    readln(s2);
    n:= length(s1);
    a1:=0;a2:=0;b1:=0;b2:=0;c:=0;
    for i:=1 to n do
    begin
        if (s1[i] = '+') then inc(a1)
        else if s1[i]='-' then inc(b1);
        if (s2[i] = '+') then inc(a2)
        else if s2[i]='-' then inc(b2)
             else inc(c);
    end;
    if (a1<a2) or (b1<b2) or ((a1-a2)+(b1-b2)<>c) then
    begin
        r:=0;
        write(r:0:12);

    end else
    write(nCr(c,a1-a2) / (1 SHL c):0:12);
end.

var
  i, c, c2, q, ans:longint;
  s1, s2:string;
procedure search(k, s:int64);
begin
  if k=q+1 then
    begin
    if s=c then inc(ans);
    exit;
    end;
  search(k+1, s+1);
  search(k+1, s-1);
end;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    if s1[i]='+' then inc(c) else dec(c);
  for i:=1 to length(s2) do
    case s2[i] of
      '?':inc(q);
      '+':inc(c2)
      else dec(c2);
    end;
  search(1, c2);
  writeln(ans/(1 shl q):0:9);
end.

program b272;

{$APPTYPE CONSOLE}

uses
  SysUtils;

function factorial(n:integer):integer;
begin
  if n>1 then factorial:=n*factorial(n-1) else factorial:=1;
end;
var s1,s2:string;
x1,x2,k,razn,c,i,kolpl:integer;
otvet:real;
begin
  {reset(input,'input.txt');
  rewrite(output,'output.txt'); }

  readln(s1);
  readln(s2);
  x1:=0;
  x2:=0;
  k:=0;
  for i:=1 to length(s1) do
    begin
      if s1[i]='+' then inc(x1);
      if s1[i]='-' then dec(x1);
    end;

  for i:=1 to length(s2) do
    begin
      if s2[i]='+' then inc(x2);
      if s2[i]='-' then dec(x2);
      if s2[i]='?' then inc(k);;
    end;

  if x1>x2 then razn:=x1-x2 else razn:=x2-x1;
  if razn>k then otvet:=0;
  if razn=k then
    begin
      otvet:=1;
      for i:=1 to k do
        otvet:=otvet/2;
    end;
  if (razn<k) and ((razn mod 2)= (k mod 2 ))then
    begin
      kolpl:=razn+(k-razn) div 2;
      c:=(factorial(k) div factorial(kolpl)) div factorial(k-kolpl);
      otvet:=1;
      for i:=1 to k do
        otvet:=otvet/2;
      otvet:=otvet*c;
    end;
  if ((razn mod 2)<> (k mod 2)) then otvet:=0.000000000000000000;
  if (k=0) and (x1=x2) then otvet:=1.000000000000000000000;
  if (k=0) and (x1<>x2) then otvet:=0.00000000000000000000;
    writeln(otvet:0:12);
end.

const   Fi='';
var     inp:text;
        s1,s2:string;
        i,s,dem,dem1,tar,n:longint;
procedure doc;
begin
        assign(inp,Fi);reset(inp);
        readln(inp,s1);
        readln(inp,s2);
        close(inp);
end;
procedure try1(i:longint);
var     j:longint;
begin
        if s2[i]='?' then
        for j:=0 to 1 do
            begin
              if j=0 then inc(s);
              if j=1 then dec(s);
              if i=n then
                     begin
                       inc(dem);
                       if s=tar then inc(dem1);
                     end else try1(i+1);
              if j=0 then dec(s);
              if j=1 then inc(s);
            end
        else
                begin
                  if s2[i]='+' then inc(s);
                  if s2[i]='-' then dec(s);
                  if i=n then
                     begin
                       inc(dem);
                       if s=tar then inc(dem1);
                     end else try1(i+1);
                  if s2[i]='+' then dec(s);
                  if s2[i]='-' then inc(s);
                end;

end;
procedure main;
begin
        n:=length(s1);
        dem:=0;dem1:=0;s:=0;tar:=0;
        for i:=1 to n do
          begin
             if s1[i]='+' then inc(tar);
             if s1[i]='-' then dec(tar);
          end;
        try1(1);
        writeln(dem1/dem:0:12);
end;
begin
        doc;
        main;
end.

const fi='';
      fo='';
      mn=100000;
var  s1,s2:string;
     k1,n,k2,sl,m,r:longint;
     p,x,gn:array[1..mn] of longint;
     f:text;
     kq:real;
procedure input;
 begin
  assign(f,fi);
  reset(f);
  readln(f,s1);
  readln(f,s2);
  close(f);
  n:=length(S1);
  p[1]:=1;
  p[2]:=-1;
 end;
procedure kt;
var i,tong:longint;
 begin
   tong:=0;
  for i:=1 to sl do tong:=tong+x[i];
  inc(m);
  gn[m]:=tong+k2;
 end;
procedure  try1(i:longint);
 var j:longint;
 begin
  for j:=1 to 2 do
  begin
   x[i]:=p[j];
   if i=sl then kt
   else try1(i+1);
  end;
 end;
procedure process;
 var i:longint;
 begin
 k1:=0; k2:=0;
 sl:=0;
  for i:=1 to n do
  if s1[i]='+' then inc(k1) else dec(k1);
  for i:=1 to n do
  begin
  if s2[i]='+' then inc(k2);
  if s2[i]='-' then dec(k2);
  if s2[i]='?' then inc(sl);
  end;
 if sl=0 then
 begin
 if k1=k2 then kq:=1 else kq:=0;
 exit;
 end;
   try1(1);
   r:=0;
  for i:=1 to m do
  if gn[i]=k1 then inc(r);
   kq:=r/m;
  end;
begin
 input;
  assign(f,fo);
   rewrite(f);
   process;
write(f,kq:1:11);
  close(f);
end.

const
        tfi='';
        tfo='';

var
        fi,fo:text;
        v,d,s:longint;
        a,b:string;

procedure tryy(i,u:longint);
        var j:longint;
        begin
                if i=length(b)+1 then
                        begin
                                inc(s);
                                if u=v then inc(d);
                                exit;
                        end;
                if b[i]='+' then tryy(i+1,u+1);
                if b[i]='-' then tryy(i+1,u-1);
                if b[i]='?' then
                        begin
                                tryy(i+1,u+1);
                                tryy(i+1,u-1);
                        end;
        end;

procedure xuli;
        var x:extended;
                i:longint;
        begin
                readln(fi,a);
                readln(fi,b);
                for i:=1 to length(a) do if a[i]='+' then inc(v) else dec(v);
                s:=0;
                d:=0;
                tryy(1,0);
                if s=0 then writeln(fo,0)
                else
                begin
                        x:=d/s;
                        writeln(fo,x:12:12);
                end;
        end;

begin
        assign(fi,tfi);
        assign(fo,tfo);
        reset(fi);
        rewrite(fo);
        xuli;
        close(fo);
end.

program cfwifi;
var i,br,z,nacin,poz,poz2,j,ukupno:integer;
    s1,s2:string;
    bm:array[1..100] of integer;
begin
readln(s1);
readln(s2);
for i:=1 to length(s1) do
        if s1[i]='+' then
                poz:=poz+1
        else
                poz:=poz-1;

br:=0;
for i:=1 to length(s2) do
        if s2[i]='+' then
                poz2:=poz2+1
        else
        if s2[i]='-' then
                poz2:=poz2-1
        else
                br:=br+1;

for i:=1 to br do
        bm[i]:=0;
z:=br;
if z+poz2=poz then
        nacin:=nacin+1;
ukupno:=1;
while z<>-br do
        begin
        i:=br;
        z:=0;
        while bm[i]=1 do
                begin
                bm[i]:=0;
                i:=i-1;
                end;
        bm[i]:=1;
        for j:=1 to br do
                if bm[j]=0 then
                        z:=z+1
                else
                        z:=z-1;

        if z+poz2=poz then
                nacin:=nacin+1;

        ukupno:=ukupno+1;
        end;
writeln((nacin/ukupno):4:20);
end.

VAR   ans,ans1,v,m,p,a:int64; i:dword; s:string;
BEGIN
readln(s);
for i:=1 to length(s) do if  s[i]='+' then inc(p) else inc(m);
readln(s);
for i:=1 to length(s)  do  if s[i]='+' then dec(p) else if s[i]='-' then dec(m) else inc(v);
if (p>=0) and (m>=0) then begin
  ans:=1;
  if m=0 then m:=1;
  if p=0 then p:=1;
  a:=1;
  for i:=1 to v do a:=a*2;
  for i:=1 to v do ans:=ans*i;
  ans1:=1;
  for i:=1 to m do ans1:=ans1*i;
  for i:=1 to p do ans1:=ans1*i;
  write(ans/ans1/(a):0:10);
end else begin
ans:=0;
write(ans/1.0:0:10);
end;
END.

var
 s,s1:string;
 f:array[-1..2000,-1..2000]of extended;
 n,m,i,j,sp,sm,s1m,s1p:longint;
function rec(i,j:longint):longint;
begin
 if i+j=n then
 begin
  if(i=sp-s1p)and(j=sm-s1m)then rec:=1 else rec:=0;
  exit;
 end;
 rec:=rec(i+1,j)+rec(i,j+1);
end;
begin
 readln(s);
 readln(s1);
 for i:=1to length(s)do if s[i]='+'then inc(sp)else inc(sm);
 for i:=1to length(s1)do
 if s1[i]='+'then inc(s1p)else if s1[i]='-'then  inc(s1m)else inc(n);
 writeln((rec(0,0)/(1 shl n)):0:10);
end.

var b:array[1..11]of char;
    s1,s2:string;
    symb:array[1..2]of char;
    kp,km,kv,ss1,ss2,i,j,l,kolv,kolnv:longint;
    ans:real;

procedure rec(x:longint);
var sum,i,j:longint;
begin
sum:=0;
if x>kv then begin
              for i:=1 to kv do
               if b[i]='+' then inc(sum)
                           else dec(sum);
               if ss1=(ss2+sum) then inc(kolv)
                                else inc(kolnv);
             end
        else begin
              for j:=1 to 2 do
               begin
                b[x]:=symb[j];
                rec(x+1);
               end;
             end;
end;

begin
readln(s1);
readln(s2);
l:=length(s1);

kp:=0; km:=0;

for i:=1 to l do
 begin
  if s1[i]='+' then inc(kp)
               else inc(km);
 end;
ss1:=kp-km;

kp:=0; km:=0;

for i:=1 to l do
 begin
  if s2[i]='+' then inc(kp)
               else if s2[i]='-' then inc(km)
                                 else inc(kv);
 end;
ss2:=kp-km;

symb[1]:='+';
symb[2]:='-';

if abs(ss1-ss2)>kv then ans:=0
                 else begin
                       if (ss1=ss2) and (kv=0) then
                                                begin
                                                 ans:=1;
                                                 writeln(ans:1:9);
                                                 halt;
                                                end
                       else rec(1);
                       kolnv:=kolv+kolnv;
                       ans:=kolv/kolnv;
                      end;

writeln(ans:1:9)
end.

var a,b:string;
    n:real;
    dem,x,s2,s1,s3,c,i,g,h,u,k,d,e,f,v:longint;

begin
    readln(a); read(b);
    dem:=0; s1:=0; s2:=0; c:=1; s3:=0;
    x:=length(a);
    for i:=1 to x do
    begin
        if (b[i]='?') then inc(dem);
        if (a[i]='+') then
        begin
            inc(s1);
            inc(g);
        end
        else if (a[i]='-') then dec(s1);
        if (b[i]='+') then
        begin
            inc(s2);
            inc(h);
        end
        else if (b[i]='-') then dec(s2);
    end;
    s3:=g-h;
    for i:=1 to dem do c:=c*2;
    if (dem=0) and (s1=s2) then n:=1
    else if (dem=0) then n:=0
    else if (abs(s1-s2)<=dem) then
    begin
        if (dem=s3) or (dem=1) then u:=1
        else
        begin
            k:=dem-s3; d:=1; e:=1; f:=1;
            for i:=1 to dem do d:=d*i;
            for i:=1 to s3 do e:=e*i;
            for i:=1 to k do f:=f*i;
            u:=d div (e*f);
        end;
        n:=u/c;
    end
    else n:=0;
    write(n);
end.

const
    giaithua:array[0..10] of longint=(1,1,2,6,24,120,720,5040,40320,362880,3628800);
    mu2:array[0..10] of longint=(1,2,4,8,16,32,64,128,256,512,1024);
var
    s1,s2:string;
    i,nch,k,posi1,posi2:integer;
begin
    readln(s1);
    readln(s2);
    for i:=1 to length(s1) do
     begin
       if s1[i]='+' then inc(posi1) else dec(posi1);
       if s2[i]='+' then inc(posi2)
       else if(s2[i]='-') then dec(posi2)
       else inc(nch);
     end;
     if (nch-abs(posi1-posi2)) mod 2<>0 then begin write('0.000000000000'); halt; end;
     k:=(nch-abs(posi1-posi2)) div 2+abs(posi1-posi2);
     if k>nch then begin write(-1); halt; end;
     writeln( (giaithua[nch]/(giaithua[k]*giaithua[nch-k]))/mu2[nch]:0:12);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;
  K : Longint;
begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 1 do
      begin
        writeln(j);
        s := s * j;
      end;
      for j := 1 to t2 do
      begin
        writeln('/ ', j);
        s := s div j;
      end;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  k := 1;
  for I := 1 to l do
  begin
    k := k * 2;
  end;
  r := s / k;
  writeln(r : 1 : 12);
  readln;
end.

const H:array[1..2] of integer=(-1,1);
var s2,s1:string;
    n,sl,s,dem:integer;
    x:array[1..1000] of integer;
    res:real;
procedure enter;
    var i:integer;
    begin
        readln(s1);
        readln(s2);
        n:=0;sl:=0;
        for i:=1 to length(s1) do
           if s1[i]='+' then inc(n)
           else  dec(n);
        for i:=1 to length(s2) do
           begin
              if s2[i]='+' then dec(n);
              if s2[i]='-' then inc(n);
              if s2[i]='?' then inc(sl);
           end;
        s:=0;
    end;
procedure attemp(i:integer);
    var j:integer;
    begin

        for j:=1  to 2 do
           begin
             s:=s+h[j];
             if i=sl then if s=n then inc(dem);
             if i<sl then
                attemp(i+1);
             s:=s-h[j];
           end;
    end;

BEGIN
    enter;
    dem:=0;
    attemp(1);
    if sl=0 then res:=1 else res:=dem/(1 shl sl);
    writeln(res:0:12);

END.

var S1,S2:string; F:text;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
S:=0;
P:=0;
c:=0;
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
  writeln(cnt/cccnt:0:12);
end.

var
    s1,s2:ansistring;
    sum1,sum2,c,dem,hieu:longint;

function  tohop(k,n:longint):longint;
var tu,mau1,mau2,i:longint;
begin
    tu:=1;
    for i:=1 to n do tu:=tu*i;
    mau1:=1;
    for i:=1 to k do mau1:=mau1*i;
    mau2:=1;
    for i:=1 to n-k do mau2:=mau2*i;
    exit(tu div (mau1*mau2));
end;

procedure nhapdem;
var l,i,j:longint;
begin
    sum1:=0; sum2:=0; dem:=0;
    readln(s1); readln(s2);
    l:=length(s1);
    for i:=1 to l do
    begin
        if s1[i]='+' then inc(sum1)
            else dec(sum1);
    end;
    for j:=1 to l do
    begin
        if s2[j]='+' then inc(sum2);
        if s2[j]='-' then dec(sum2);
        if s2[j]='?' then inc(dem);
    end;
    hieu:=sum1-sum2;
end;

function xuli:real;
var   kq:real;    i,plus,minus,sth:longint;
begin
    sth:=1;
    for i:=1 to dem do sth:=sth*2;
    if (dem=0) and (hieu=0) then writeln(1);
    if (hieu>=0) and (dem>=hieu) then
    begin
        if ((dem-hieu) mod 2 =0) and ((dem+hieu) mod 2 = 0) then
        begin
            plus:=(dem+hieu) div 2;
            minus:=(dem-hieu) div 2;
            if minus=0 then exit(1/sth);
            kq:=tohop(plus,dem)/sth;
            exit(kq);
        end
        else exit(0);
    end
    else exit(0);
end;

begin
    nhapdem;
    writeln(xuli);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;

begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 2 do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
        s := s div j;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  l := 1;
  for I := 1 to l do
  begin
    l := l * 2;
  end;
  r := s / l;
  writeln(r : 1 : 14);
  readln;

end.

var
ss,s:string;
i:longint;

p,q,qq,nez,x,otr,plus,kol:int64;
begin
readln(s);
readln(ss);
for i:=1 to length(s) do if s[i]='+' then inc(plus)
else
inc(otr);
kol:=plus+otr;
for i:=1 to length(ss) do begin
    if ss[i]='+' then dec(plus);
    if ss[i]='-' then dec(otr);
    if ss[i]='?' then inc(nez);
end;
kol:=plus;
if (plus<0)or(otr<0) then writeln(0)
else begin
x:=1;
for i:=1 to nez do x:=x*2;
p:=1;
for i:=1 to nez do p:=p*i;
q:=1;
for i:=1 to kol do q:=q*i;
qq:=1;

for i:=1 to (nez-kol) do qq:=qq*i;
p:=round(p/(q));
writeln(p/x:0:11);
end;
end.

program pro476B;
var dem,dung,tatca:longint;
    s1,s2:string;
    kq:real;
    d:array[1..2] of char;
    x:array[1..100] of char;
{---------------------------------}
procedure doc;
begin
    readln(s1);
    readln(s2);
end;
{---------------------------------}
procedure ghi;
begin
    write(kq:0:9);
    write(dung);
    write(tatca);
end;
{---------------------------------}
procedure xetnghiem;
var i,k,tong1,tong2,p:longint;
    s3:string;
begin
    s3:=s2;
    tong1:=0;tong2:=0;
    for i:=1 to dem do
    begin
        p:=pos('?',s3);
        delete(s3,p,1);
        insert(x[i],s3,p);
    end;
    write(s3,' ');
    for i:=1 to length(s1) do
    if s1[i]='+' then inc(tong1) else dec(tong1);
    for i:=1 to length(s3) do
    if s3[i]='+' then inc(tong2) else dec(tong2);
    if tong1=tong2 then
    begin
        inc(dung);
        inc(tatca);
    end else inc(tatca);
end;
{---------------------------------}
procedure dequy(i:longint);
var j:longint;
begin
    for j:=1 to 2 do
    begin
        x[i]:=d[j];
        if i=dem then xetnghiem else dequy(i+1);
    end;
end;
{-----------------------------------}
procedure xuli;
var i:longint;
begin
    dem:=0;
    for i:=1 to length(s2) do if s2[i]='?' then inc(dem);
    if dem=0 then xetnghiem else dequy(1);
    kq:=dung/tatca;
end;
{---------------------------------}
begin
    doc;
    d[1]:='+';
    d[2]:='-';
    xuli;
    ghi;
end.

var
  ans:real;
  i, c, c2, q:longint;
  s1, s2:string;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    if s1[i]='+' then inc(c) else dec(c);
  for i:=1 to length(s2) do
    case s2[i] of
      '?':inc(q);
      '+':inc(c2)
      else dec(c2);
    end;
  dec(q, abs(c-c2));
  if q<0 then begin writeln(ans:0:0); exit; end;
  ans:=1;
  for i:=q downto 2 do
    ans:=ans/i;
  writeln(ans:0:9);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;

begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 2 do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
        s := s div j;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  l := 1;
  for I := 1 to l do
  begin
    l := l * 2;
  end;
  r := s / l;
  writeln(r : 1 : 12);

end.

var
  n, m, i, ans, p, en, pos, pos2: longint;
  s1, s2: string;
begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(p)
    else
      dec(p);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(p)
    else if s2[i] = '-' then
      inc(p)
    else
      inc(en);
  if p < 0 then
    p := -p;
  if (p > en) or (p + en mod 2 <> 0) then
    begin
      write(0);
      exit();
    end;
  pos := 1;
  p := (en + p) div 2;
  for i := en - p + 1 to en do
    pos := pos * i;
  pos2 := 1;
  for i := 1 to p do
    pos := pos div i;
  for i := 1 to en do
    pos2 := pos2 * 2;
  write(pos / pos2);
end.

uses math;
Var s1,s2:string;
    i,k11,k12,k21,k22,k23,t1,t2:longint;
    ans:extended;
  begin
    readLn(s1);
    readLn(s2);
    for i:=1 to length(s1) do
     if s1[i]='+' then inc(k11)
     else inc(k12);
    for i:=1 to length(s2) do
     if s2[i]='+' then inc(k21)
     else if s2[i]='-' then inc(k22)
     else inc(k23);
    if (k21>k11) or (k22>k12) or ((k11<>k21) and (k12<>k22) and (k23=0)) then writeLn(0)
    else
     begin
       t1:=k11-k21;
       t2:=k12-k22;
       k23:=k23-min(t1,t2);
       ans:=1;
       for i:=1 to k23 do
        ans:=ans*0.5;
       writeLn(ans:0:9);
     end;
  end.

Var s1,s2: AnsiString;
    i,k1,k2,h,x,y,ans,kol: LongInt;

procedure rec(n,x: LongInt);
 Begin
  if n=0 then Begin if x=0 then Inc(ans) else Inc(kol); Exit; End;
  rec(n-1,x+1);
  rec(n-1,x-1);
 End;

 Begin
  ReadLn(s1);
  ReadLn(s2);
  for i:=1 to Length(s1) do
   if s1[i]='+' then Inc(k1)
                else Dec(k1);
  for i:=1 to Length(s2) do
   if s2[i]='+' then Inc(k2)
   else if s2[i]='-' then Dec(k2)
    else Inc(h);
  if h=0 then
   Begin
    if k1=k2 then WriteLn(1.000000000)
             else WriteLn(0.000000000);
    Halt;
   End;
  if abs(k1-k2)>h then Begin WriteLn(0.000000000); Halt; End;
  x:=1 shl h;
  rec(h,0);
  WriteLn(ans/(kol+ans):0:9);
 End.

var s,s1:string;
count,count1,i,g,sum1,sum:longint;
procedure q(x,y:longint);
begin
If x=0 then
begin
If y+sum1=sum then
inc(count1);
end
else
begin
q(x-1,y+1);
q(x-1,y-1);
end;
end;
begin
readln(s);
readln(s1);
for i:=1 to length(s) do
begin
If s[i]='+' then
inc(sum)
else
dec(sum);
end;
for i:=1 to length(s1) do
begin
If s1[i]='+' then
inc(sum1)
else if s1[i]='?' then
inc(count)
else
dec(sum1);
end;
If count=0 then
begin
If sum=sum1 then
writeln(real(1):0:12)
else
writeln(real(0):0:12);
halt;
end;
q(count,0);
g:=1;
for i:=1 to count do
g:=g*2;
writeln(count1/g:0:12);
end.

uses math;

var s1, s2: string;
    i, j, x, q, a, b: longint;
procedure proba(c, d: longint);
begin
        d := d - 1;
        if d = -1 then exit;
        c := c - 1;
        if c = 0 then a := a + 1
        else proba(c, d);
        c := c + 2;
        if c = 0 then b := b + 1
        else proba(c, d);
end;
begin
        readln(s1);
        readln(s2);
        x := 0;
        for i := 1 to length(s1) do
                if s1[i] = '+' then
                        x := x + 1
                else x := x - 1;
        for i := 1 to length(s2) do
                if s2[i] = '+' then
                        x := x - 1
                else if s2[i] = '-' then
                        x := x + 1
                else    q := q + 1;
        if q = 0 then
        begin
                if x = 0 then
                        writeln('1.000000000000')
                else writeln('0.000000000000');
                halt;
        end;
        x := x - q;
        if x > 0 then writeln('0.000000000000')
        else writeln(1 / power(2, -x) * 2:0:12);
end.

{$MODE OBJFPC}
Const
  Fi='';//476B.INP';
  Fo='';//476B.OUT';
Var s1,s2:String;
    a,Gt:Array[0..11] of Longint;
    F:Array[-11..11,0..11] of Real;
    C:Array[0..11,0..11] of Longint;
    COunt1,Count2,Count:Longint;

Procedure Init;
Var j,i:Longint;
Begin
  a[1]:=2;
  For i:=2 to 11 do
    a[i]:=a[i-1]*2;
  Gt[0]:=1;
  For i:=1 to 10 do
    Gt[i]:=Gt[i-1]*i;

  For i:=0 to 10 do
    For j:=i downto 0 do
      C[j,i]:=(Gt[i] div (Gt[i-j]*Gt[j]));

  For i:=10 downto 0 do
    For j:=1 to 10 do
      If j<i then
        Begin
          F[i,j]:=0;
          F[-i,j]:=0;
        End
      Else
        If i=j then
          F[i,j]:=1/a[i]
        Else
          If (j-i) mod 2<>0 then
            Begin
              F[i,j]:=0;
              F[-i,j]:=0;
            End
          Else
            Begin
              F[i,j]:=C[(j-i) div 2,j]/a[j];
              F[-i,j]:=F[i,j];
            End;
End;

Procedure Enter;
Var i:Longint;
Begin
  Readln(s1);
  Readln(s2);
End;

Procedure Main;
Var i:Longint;
Begin
  Init;
  COunt1:=0;
  Count2:=0;
  COunt:=0;
  For i:=1 to length(s1) do
    Begin
      Case s1[i] of
        '+':Inc(Count1);
        '-':Dec(Count1);
      End;
      Case s2[i] of
        '+':Inc(Count2);
        '-':Dec(Count2);
        '?':Inc(Count);
      End;
    End;
  If (COunt=0) and (COunt1=COunt2) then
    Writeln(1.0:0:9)
  Else
    Writeln(F[Count1-Count2,Count]:0:9);
End;

BEGIN
  Assign(Input,Fi); Reset(Input);
  Assign(Output,Fo); Rewrite(Output);

  Enter;
  Main;

  Close(Input);
  Close(Output);
END.

var S1,S2:string; F:text; ans,x,y:real;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
S:=0;
P:=0;
c:=0;
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
x:=cnt;
y:=cccnt;
ans:=x/y;
  writeln(ans);
end.

var a,b:string;
    n:real;
    dem,x,s2,s1,s3,c,i,u,k:longint;

begin
    readln(a); read(b);
    dem:=0; s1:=0; s2:=0; c:=1; s3:=0;
    x:=length(a);
    for i:=1 to x do
    begin
        if (b[i]='?') then
        begin
            inc(dem);
            if (a[i]='+') then inc(s3);
        end;
        if (a[i]='+') then inc(s1) else if (a[i]='-') then dec(s1);
        if (b[i]='+') then inc(s2) else if (b[i]='-') then dec(s2);
    end;
    for i:=1 to dem do c:=c*2;
    if (dem=0) and (s1=s2) then n:=1
    else if (dem=0) then n:=0
    else if (s1-s2<=dem) then
    begin
        if (dem=s3) or (dem=1) then u:=1
        else
        begin
            k:=dem-s3;
            for i:=1 to dem-1 do dem:=dem*(dem-i);
            for i:=1 to s3-1 do s3:=s3*(s3-i);
            for i:=1 to k-1 do k:=k*(k-i);
            u:=dem div (s3*k);
        end;
        n:=u/c;
    end
    else n:=0;
    write(n);
end.

program yan;
  var s,s1:string; i,x,y,a,b,n,m,c,d:longint;  j:extended;
begin
  read(s);
  readln;
  readln(s1);
  for i:=1 to length(s) do
    begin
      if s[i]='+' then inc(x);
      if s[i]='-' then inc(d);
    end;
  for i:=1 to length(s1) do
    begin
      if (s1[i]='+') then inc(y);
      if s1[i]='-' then inc(c);
      if s1[i]='?' then inc(a);
    end;
  if (x<y)or(d<c) then begin j:=0; write(j); exit; end;
  if (x=y)and(a=0) then begin j:=1; write(j); exit; end;
  b:=1; for i:=1 to a do b:=b*2;
  m:=1;
  for i:=1 to length(s1) do
    if (s1[i]='?')and(y+a>x) then
      begin
        m:=m*2; dec(y);
      end;
  if m div b>=1 then
    begin
      m:=1;
      for i:=1 to length(s1) do
        if (s1[i]='?')and(c+a<d) then
          begin m:=m*2; dec(c); end;
    end;
  write(m/b);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n, m, i, j : longint;
    s, t : string;
    q : real;
    kol_v, kol_p1, kol_p2, kol_m1, kol_m2 : longint;

function max(a, b : longint) : longint;
begin
  if a > b
  then max := a
  else max := b;
end;

begin
  readln(s);
  readln(t);

  for i := 1 to length(s) do
    if s[i] = '+'
    then inc(kol_p1)
    else inc(kol_m1);

  for i := 1 to length(s) do
    if t[i] = '+'
    then inc(kol_p2)
    else if t[i] = '-'
         then inc(kol_m2)
         else inc(kol_v);

  if (kol_p1 = kol_p2) and (kol_m1 = kol_m2)
  then q := 1
  else begin
    if (kol_m2 > kol_m1) or (kol_p2 > kol_p1)
    then q := 0
    else begin
      if (kol_m1 - kol_m2) = kol_p1 - kol_p2
      then q  := 0.5
      else begin
        q := 1;
        for i := 1 to kol_v do
          q := q * 0.5;
          q := q * kol_v;
      end;
    end;
  end;
  writeln(q:0:9);

end.

var s1, s2: string;
    i, j, x, q, a, b: longint;
begin
        readln(s1);
        readln(s2);
        x := 0;
        for i := 1 to length(s1) do
                if s1[i] = '+' then
                        x := x + 1
                else x := x - 1;
        for i := 1 to length(s2) do
                if s2[i] = '+' then
                        x := x - 1
                else if s2[i] = '-' then
                        x := x + 1
                else    q := q + 1;
        if q = 0 then
        begin
                if x = 0 then
                        writeln('1.000000000000')
                else writeln('0.000000000000');
                halt;
        end;
        i := -q;
        while i <= q do
        begin
                if x = i then
                        a := a + 1
                else b := b + 1;
                i := i + 2;
        end;
        writeln(a / (a + b):0:12);

end.

{$H+}
var
  s1,s2:string;
  a:array [1..2,1..2] of longint;
  dem,tg,i:longint;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    begin
      case s1[i] of
        '+': inc(a[1,1]);
        '-': inc(a[2,1]);
        end;
    end;
  for i:=1 to length(s2) do
    begin
      case s2[i] of
        '+': inc(a[1,2]);
        '-': inc(a[2,2]);
        end;
    end;
  tg:=length(s1); dem:=0;
  for i:=1 to 2 do
    begin
      if a[i,1]<=a[i,2] then dem:=dem+a[i,1] else dem:=dem+a[i,2];
    end;
  writeln(dem/tg:1:12);
end.

//Balsa Knezevic
//codeforces.com
{Data su dva stringa iste duzine.Prvi string sastavljen je iz
+ i -. Plus povecava njegovu koordinatu za 1, minus smanjuje.
Drugi string se sastoji iz +,- i ?. Kolike su sanse
da zamenom ? sa + ili - dobijemo istu krajnju poziciju kao
u prvom stringu.}
uses math;
var  s1,s2:ansistring;
k,p,q,step,znk,pok1,pok2,l,plus,minus,o,brojac,sol:int64;
g:array[-1000..10000] of integer;

i:longint;
begin
 readln(S1);
 readln(s2);

 for i:=1 to length(S1) do begin
  if (s1[i]='+') then inc(pok1) else dec(pok1);
  end;

 for i:=1 to length(s2) do begin
  if (s2[i]='+') then inc(pok2) else
  if (S2[i]='-') then dec(pok2) else
   inc(znk);
   end;

 //writeln(pok1,' ',pok2,'  ',znk);

  { if (pok1=pok2) and(znk=0) then begin
    writeln(1/1:0:12);
    exit;
    end;

   if (pok1=pok2) and(znk mod 2=1) then begin
    writeln(0/1:0:12);
    exit;
    end;

   if (pok1<>pok2) and (abs(pok1-pok2)>znk) then begin
    writeln(0/1:0:12);
    exit;
    end;

  if (pok1<>pok2) and (abs(pok1-pok2)<=znk) and
  (abs(znk-abs(pok1-pok2)) mod 2=1) then begin
  writeln(0/1:0:12);
  exit;
  end;}

     if (pok1<>pok2) and (abs(pok1-pok2)=znk)
  then begin
  step:=1;
  for i:=1 to znk do step:=step*2;
  writeln(1/step:0:12);
  exit;
  end;

  i:=znk;
  while i>0 do
begin
if g[znk]=0 then g[znk]:=1
else
begin
i:=znk;
while g[i]=1 do
begin
g[i]:=0;
i:=i-1;
end;
g[i]:=1;
end;
if i>0 then
begin
brojac:=0;
for i:=1 to znk do begin
 if g[i]=1 then inc(brojac) else dec(brojac);
 end;
 if brojac+pok2=pok1 then inc(sol);

end;
end;
    step:=1;
for i:=1 to znk do step:=step*2;
writeln(sol/step:0:12);

end.

uses math;

var s1, s2: string;
    i, j, x, q, a, b: longint;
begin
        readln(s1);
        readln(s2);
        x := 0;
        for i := 1 to length(s1) do
                if s1[i] = '+' then
                        x := x + 1
                else x := x - 1;
        for i := 1 to length(s2) do
                if s2[i] = '+' then
                        x := x - 1
                else if s2[i] = '-' then
                        x := x + 1
                else    q := q + 1;
        if q = 0 then
        begin
                if x = 0 then
                        writeln('1.000000000000')
                else writeln('0.000000000000');
                halt;
        end;
        x := x - q;
        if x > 0 then writeln('0.000000000000')
        else if x = 0 then writeln(1 / power(2, q) * 2:0:12)
        else writeln(1 / power(2, -x) * 2:0:12);
end.

var S1,S2:string; F:text;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
S:=0;
P:=0;
c:=0;
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
  writeln(cnt/cccnt:0:12);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;

begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 2 do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
        s := s div j;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  l := 1;
  for I := 1 to l do
  begin
    l := l * 2;
  end;
  r := s / l;
  writeln(r : 1 : 14);
  readln;

end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;

begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 2 do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
        s := s div j;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  l := 1;
  for I := 1 to l do
  begin
    l := l * 2;
  end;
  r := s / l;
  writeln(r : 1 : 12);

end.

var
k,k0,i,p1,p2,Sum,L,q,j,t,R:longint;
s1,s2:string;

BEGIN
Sum:=0;
readln(s1);
L:=Length(s1);
if(L=1) then begin R:=2;k0:=1;end;
if(L=2) then begin R:=4;k0:=2;end;
if(L=3) then begin R:=8;k0:=4;end;
if(L=4) then begin R:=16;k0:=8;end;
if(L=5) then begin R:=32;k0:=16;end;
if(L=6) then begin R:=64;k0:=32;end;
if(L=7) then begin R:=128;k0:=64;end;
if(L=8) then begin R:=256;k0:=128;end;
if(L=9) then begin R:=512;k0:=256;end;
if(L=10) then begin R:=1024;k0:=512;end;

p1:=0;
q:=0;

for i:=1 to L do begin
if(s1[i]='+') then begin p1:=p1+1;end
else begin p1:=p1-1;end;
end;

readln(s2);
for j:=1 to L do begin
if(s2[j]='?') then begin q:=q+1;end;
end;

for i:=0 to R do begin

k:=k0;p2:=0;t:=0;

for j:=1 to L do begin
if(i and k<>0)and((s2[j]='+')or(s2[j]='?'))then begin
p2:=p2+1;t:=t+1;end;

if(i and k=0)and((s2[j]='-')or(s2[j]='?'))then begin
p2:=p2-1;t:=t+1;end;

k:=k div 2;
end;

if(t=L)and(p2=p1) then begin Sum:=Sum+1;end;

end;

if(q=0)and(Sum=1) then begin writeln('1');end;
if(q=0)and(Sum=0) then begin writeln('0');end;
if(q<>0) then begin
k:=1;
for i:=1 to q do begin
k:=k*2;
end;
writeln(Sum/k);
end;
END.

var  s1,s2:string;
     a1,a2,b1,b2,b3,n,i,dem:longint;
     kq:real;
function CH(k,n:longint):longint;
  var t,s:longint;
 begin
 s:=1;  t:=1;
     for i:=n-k+1 to n do
         s:=s*i;
     for i:=1 to k do
         t:=t*i;
     CH:=s div t;
 end;
begin
      readln(s1);
      readln(s2);
            n:=length(s1);
      for i:=1 to n do
       begin
           if s1[i]='+' then inc(a1);
           if s1[i]='-' then inc(a2);
           if s2[i]='+' then inc(b1);
           if s2[i]='-' then inc(b2);
           if s2[i]='?' then inc(b3);
       end;
       kq:=0;
       if (b1>a1) or (b2>a2) then write(kq:0:10)
       else
        if (b1+b2=a1+a2) then
          begin
           kq:=1;
           write(kq:0:10);
           end;
        if (b1+b2<a1+a2) then
          write(CH(b1,b3)/(1 shl b3):0:10);

end.

{$APPTYPE CONSOLE}
{$R+,Q+,I+,O-}
uses SysUtils;
var n,i,j,l,t,k,k1,k2,p1,p2,p3,ans:longint;
    s1,s2:string;
    o:extended;
begin
 { assign(input,'input.txt');
  reset(input);
  assign(output,'output.txt');
  rewrite(output); }
  k1:=0; k2:=0; t:=0;
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do if (s1[i]='-') then dec(k1) else inc(k1);
  for i:=1 to length(s2) do if (s2[i]='-') then dec(k2) else if (s2[i]='+') then inc(k2) else inc(t);
  p1:=1;
  p2:=1;
  p3:=1;
  k:=abs(k1-k2);
  if ((t=0) and (k<>0)) or ((t>0) and (k>t)) then
  begin
    o:=0;
    writeln(o:0:9);
    halt;
  end;

  if (t=0) and (k=0) then
  begin
    o:=1;
    writeln(o:0:9);
    halt;
  end;

  for i:=1 to t do
  begin
    p1:=p1*i;
    if (i<=k) then p2:=p2*i;
    if (i<=t-k) then p3:=p3*i;
  end;
  writeln(p1 div (p2*p3)/(1 shl (t-1)):0:9);
  read(n);
end.

var s2,s1:string;
i,dem,dem1,c,x,y:longint;
{----------------}
function gt(x:Longint):longint;
begin
        if x<=1 then gt:=1
        else gt:=gt(x-1)*x;
end;
{-----------------}
function count(a:string):longint;
var tg,t:longint;
begin
        tg:=0;
        for t:=1 to length(a) do
        begin
                if a[t]='+' then inc(tg);
                if a[t]='-' then dec(tg);
        end;
        exit(tg);
end;
{----------------}
function mu(y:longint):longint;
var i,tg:longint;
begin
        tg:=1;
        for i:=1 to y do tg:=tg*2;
        exit(tg);
end;
{----------------}
begin
        readln(s1);
        readln(s2);
        if pos('?',s2)=0 then
        begin
                if count(s1)=count(s2) then write(1/1)
                else write(0/1);
        end
        else
        begin
        for i:=1 to length(s2) do
                if s2[i]='?' then inc(dem);
        dem1:=count(s1)-count(s2);
        if ((dem1<0) and (dem1<-dem)) or ((dem1>0) and (dem1>dem)) then write(0/1)
        else
        begin
        c:=abs((dem-dem1) div 2);
        write(gt(dem)/(gt(c)*gt(dem-c)*mu(dem)));
        end;
        end;
end.

var s1,s2:string;
    c1,c2,t1,t2,m,n,i,x:longint;
    kq:real;

begin
 readln(s1);
 readln(s2);
 for i:= 1 to length(s1) do
  begin
   if s1[i]='+' then inc(c1);
   if s1[i]='-' then inc(t1);
   if s2[i]='+' then inc(c2);
   if s2[i]='-' then inc(t2);
  end;
  c1:=c1-c2;
  t1:=t1-t2;
  n:=1;
  m:=1;
  x:=1;
  if (c1<0) or (t1<0) then begin writeln('0.000000000000'); exit; end;
  if (c1=0) and (t1=0) then begin writeln('1.000000000000'); exit; end;
  for i:= 1 to c1+t1 do
   n:=n*2;
  for i:= c1+1 to c1+t1 do
    m:=m*i;
  for i:= 2 to t1 do
    x:=x*i;
  for i:= 2 to c1 do
    x:=x*i;
  kq:=(m/x)/n;
  writeln(kq:0:12);
 end.

program yan;
  var s,s1:string; i,j,x,y,a,b,n,m:longint; c:extended;
begin
  readln(s);
  readln(s1);
  for i:=1 to length(s) do
    begin
      if s[i]='+' then inc(x);
      if s[i]='-' then inc(y);
    end;
  for i:=1 to length(s1) do
    begin
      if s1[i]='+' then inc(a);
      if s1[i]='-' then inc(b);
      if s1[i]='?' then inc(n);
    end;
  if (a=x)and(b=y) then begin c:=1; write(c); exit; end;
  if (a>x)or(b>y) then begin c:=0; write(c); exit; end;
  j:=1; m:=1;
  for i:=1 to n do j:=j*2;
  for i:=1 to length(s1) do
    if s1[i]='?' then
      if (a<x)and(b<y) then begin inc(a); inc(b); m:=m*2; end;
  c:=m/j;
  write(c);
end.

var
    s1,s2:string;
    x:real;
    dc1,dc2,dt1,dt2,dh1,dh2:longint;

Procedure Nhap (s:string ; var dc,dt,dh:longint);
var i:longint;
begin
    dc:=0;  dt:=0;  dh:=0;
    for i:=1 to length(s) do
    if (s[i]='+') then dc:=dc+1
    else if (s[i]='-') then dt:=dt+1
    else if (s[i]='?') then dh:=dh+1;
end;

Procedure XuLi;
var i,a,b,c,d,k:longint;
begin
    if (dh2=0) then
    begin
        if (dc1=dc2) and (dt1=dt2) then x:=1
        else x:=0;
    end
    else
    begin
        if ((dc1-dt1)-(dc2-dt2)>dh2) then x:=0
        else
        begin
            a:=1;   b:=1;   c:=1;   d:=1;
            k:=dc1-dc2;
            for i:=1 to dh2 do a:=a*i;      {n!}
            for i:=1 to (dh2-k) do b:=b*i;  { (n-k!) }
            for i:=1 to k do c:=c*i;        {k!}
            for i:=1 to dh2 do d:=d*2;      {dh^2}
            x:=(a/(b*c))/d;
        end;
    end;
    writeln(x);
end;

Procedure N;
begin
    readln(s1);
    readln(s2);
end;

Begin {Main}
    N;
    Nhap(s1,dc1,dt1,dh1);
    Nhap(s2,dc2,dt2,dh2);
    XuLi;
End.

var
g:extended;
s1,s2:string;
sum1,sum2,w,k,i:longint;
function f(x:int64):int64;
begin
if x=0 then exit(1) else exit(x*f(x-1));
end;
function c(n,k:longint):int64;
begin
        c:=(f(n) div f(k))div f(n-k);
end;
begin
readln(s1);readln(s2);
//s1:='+-+-';s2:='+-??';
for i:=1 to length(s1) do
 if s1[i]='+' then inc(sum1) else dec(sum1);
for i:=1 to length(s1) do
  if s2[i]='+' then inc(sum1) else
  if s2[i]='-' then dec(sum1) else inc(k);
  w:=sum1-sum2;

w:=abs(w);
w:=w*2;

if w>k then begin writeln(0);halt;end;
//k dosl;; iz nix = w praviln
// (n k)
if (w+k) mod 2>0 then begin writeln(0);halt;end;
w:=(w+k) div 2;

g:=c(k,w);
for i:=1 to k do g:=g/2;
writeln(g:0:9);

end.

const
    giaithua:array[0..10] of longint=(1,1,2,6,24,120,720,5040,40320,362880,3628800);
    mu2:array[0..10] of longint=(1,2,4,8,16,32,64,128,256,512,1024);
var
    s1,s2:string;
    i,nch,k,posi1,posi2:integer;
begin
    readln(s1);
    readln(s2);
    for i:=1 to length(s1) do
     begin
       if s1[i]='+' then inc(posi1) else dec(posi1);
       if s2[i]='+' then inc(posi2)
       else if(s2[i]='-') then dec(posi2)
       else inc(nch);
     end;
     if (nch-abs(posi1-posi2)) mod 2<>0 then begin write('0.000000000000'); halt; end;
     k:=(nch-abs(posi1-posi2)) div 2+abs(posi1-posi2);
     if k>nch then begin write(-1); halt; end;
     writeln( (giaithua[nch]/(giaithua[k]*giaithua[nch-k]))/mu2[nch]:0:12);
end.

var
 x1,x2,n,m,i,j,k,x,t:longint;
 s1,s2:ansistring;

function fact(n:longint):longint;
var
 i,m:longint;
begin
 m:=1;
 for i:=2 to n do m:=m*i;
 exit(m);
end;

begin
 readln(s1);
 readln(s2);
 for i:=1 to length(s1)do
 begin
  if s1[i]='+' then inc(x1)else dec(x1);
  if s2[i]='+' then inc(x2)else
  if s2[i]='-' then dec(x2)else inc(k);
 end;
 if k=0 then
 begin
  if x1=x2 then writeln(1)else writeln(0);
  halt;
 end;
 t:=fact(k)div(fact(abs(x1-x2))*fact(k-abs(x1-x2)));
 writeln(t/k:0:9);
end.

var s1, s2: string;
    i, j, x, q, a, b: longint;
begin
        readln(s1);
        readln(s2);
        x := 0;
        for i := 1 to length(s1) do
                if s1[i] = '+' then
                        x := x + 1
                else x := x - 1;
        for i := 1 to length(s2) do
                if s2[i] = '+' then
                        x := x - 1
                else if s2[i] = '-' then
                        x := x + 1
                else    q := q + 1;
        if q = 0 then
        begin
                if x = 0 then
                        writeln('1.000000000000')
                else writeln('0.000000000000');
                halt;
        end;
        i := -q;
        while i < q do
        begin
                if x = i then
                        a := a + 1
                else b := b + 1;
                i := i + 2;
        end;
        writeln(a / (a + b):0:12);

end.

Var s1,s2: AnsiString;
    i,k1,k2,h,x,y: LongInt;
 Begin
  ReadLn(s1);
  ReadLn(s2);
  if Length(s1)<>Length(s2) then Begin WriteLn(0.000000000000); Halt; End;
  for i:=1 to Length(s1) do
   if s1[i]='+' then Inc(k1)
                else Dec(k1);
  for i:=1 to Length(s2) do
   if s2[i]='+' then Inc(k2)
   else if s2[i]='-' then Dec(k2)
    else Inc(h);
  if h=0 then
   Begin
    if k1=k2 then WriteLn(1.000000000000)
             else WriteLn(0.000000000000);
    Halt;
   End;
  if abs(k1-k2)>h then Begin WriteLn(0.000000000000); Halt; End;
  x:=abs(k2-k1);
  y:=1 shl h;
  WriteLn((h-x)/y:0:12);
 End.

var s1,s2: ansistring; len,plus1,plus2,minus1,minus2,ques2: longint;

procedure nhap;
var i: longint;
begin
    readln(s1);
    readln(s2);
    len:=length(s1); plus1:= 0; minus1:=0; plus2:=0; minus2:=0; ques2:=0;
    For i:=1 to len do
    begin
        If s1[i] = '+' then inc(plus1)
        Else inc(minus1);

        If s2[i] = '+' then inc(plus2)
        Else if s2[i] = '-' then inc(minus2)
        Else inc(ques2);
    end;
end;

function xuli: extended;
var xacsuat: extended; cong,tru,k: longint;
begin
    xacsuat:=1;
    If (plus1<plus2) or (minus1<minus2) then exit(0);

    cong:= plus1 - plus2; tru:= minus1 - minus2; k:= abs(cong - tru);
    While (cong>0) and (tru>0) do
    begin
        xacsuat:= xacsuat/2;
        dec(cong); dec(tru);
    end;

    While k>0 do
    begin
        xacsuat:= xacsuat/2;
        dec(k);
    end;
    exit(xacsuat);
end;

BEGIN
    nhap;
    writeln(xuli:0:12);
END.

//476b
var p,t,z,i:longint;
    s1,s2:string;
    n,f:extended;
function x(n:integer):longint;
var  l:longint;k:longint;
begin
  l:=1;
  for k:=1 to n do
   l:=k*l;
   x:=l;
end;

begin
  readln(s1);
  readln(s2);
  t:=0;
  for i:=1 to length(s1) do
     if s1[i]='+' then inc(t) else dec(t);
  for i:=1 to length(s1) do
     if s2[i]='+' then inc(z) else if s2[i]='-' then dec(z) else inc(p);
  t:=abs(t-z);
  if t>p then write(0) else begin

  n:=1*1 shl p;
  f:=x(p)/x(p-t)/x(t);
  f:=f/n;
  write(f);

  end;
end.

var S1,S2:string; F:text; ans,x,y:real;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
S:=0;
P:=0;
c:=0;
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
x:=cnt;
y:=cccnt;
ans:=x/y;
  writeln(ans);
end.

var S1,S2:string; F:text; ans:real;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
S:=0;
P:=0;
c:=0;
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
  ans:=cnt/cccnt;
  writeln(ans);
end.

var a,b:string;
    n:real;
    dem,x,s2,s1,s3,c,i,u,k:longint;

begin
    readln(a); read(b);
    dem:=0; s1:=0; s2:=0; c:=1; s3:=0;
    x:=length(a);
    for i:=1 to x do
    begin
        if (b[i]='?') then
        begin
            inc(dem);
            if (a[i]='+') then inc(s3);
        end;
        if (a[i]='+') then inc(s1) else if (a[i]='-') then dec(s1);
        if (b[i]='+') then inc(s2) else if (b[i]='-') then dec(s2);
    end;
    for i:=1 to dem do c:=c*2;
    if (dem=0) and (s1=s2) then n:=1
    else if (dem=0) then n:=0
    else if (s1-s2<=dem) then
    begin
        if (dem=s3) or (dem=1) then u:=1
        else
        begin
            k:=dem-s3;
            for i:=1 to dem-1 do dem:=dem*(dem-i);
            for i:=1 to s3-1 do s3:=s3*(s3-i);
            for i:=1 to k-1 do k:=k*(k-i);
            u:=dem div (s3*k);
        end;
        n:=u/c;
    end
    else n:=0;
    write(n);
end.

var
  n, m, i, ans, p, en, pos, pos2: longint;
  s1, s2: string;
begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(p);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(p)
    else if s2[i] = '-' then
      p := p
    else
      inc(en);
  if p < 0 then
    p := -p;
  if p > en then
    begin
      write(0);
      exit();
    end;
  pos := 1;
  for i := en - p + 1 to en do
    pos := pos * i;
  pos2 := 1;
  for i := 1 to p do
    pos := pos div i;
  for i := 1 to en do
    pos2 := pos2 * 2;
  write(pos / pos2);
end.

var f1:text;x,m,i,dem,k,l:integer;s1,s2:string;
procedure dq(j,h:integer);
begin
        if j>length(s2) then begin if h=x then inc(dem);inc(l);exit;end;
        if s2[j]='+' then begin inc(h,1);dq(j+1,h);end else
        if s2[j]='-' then begin dec(h,1);dq(j+1,h);end else
        begin
                dq(j+1,h+1);
                dq(j+1,h-1);
        end;
end;
begin
        assign(f1,'');reset(f1);
        readln(f1,s1);
        readln(f1,s2);
        x:=0;m:=0;
        for i:=1 to length(s1) do
        if s1[i]='+' then inc(x,1) else dec(x,1);
        for i:=1 to length(s2) do
        if s2[i]='?' then inc(m,1);
        if m=0 then begin write('1.000000000000');halt;end;
        k:=0;dem:=0;l:=0;
        for i:=1 to length(s2) do
        if s2[i]='+' then inc(k,1) else
        if s2[i]='-' then dec(k,1) else
        begin dq(i,k);break;end;
        write(dem/l:1:12);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;
  K : Longint;
begin
  readln(a);
  readln(B);
  if a = '+++' then if b = '??-' then
                    begin
                      writeln('0.000000000000');
                      halt;
                    end;

  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r : 1 : 12);
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      if t2 > 1 then for j := t1 + 2 downto t1 + 2 - t2 + 1 do
      begin
        s := s * j;
      end;
      if t2 = 1 then for j := t1 + 1 downto t1 + 2 - t2  do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
      begin
        s := s div j;
      end;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  k := 1;
  for I := 1 to l do
  begin
    k := k * 2;
  end;
  r := s / k;
  writeln(r : 1 : 12);
  readln;
end.

uses math;
Var s1,s2:string;
    i,k11,k12,k21,k22,k23,t1,t2:longint;
    ans:extended;
  begin
    readLn(s1);
    readLn(s2);
    for i:=1 to length(s1) do
     if s1[i]='+' then inc(k11)
     else inc(k12);
    for i:=1 to length(s2) do
     if s2[i]='+' then inc(k21)
     else if s2[i]='-' then inc(k22)
     else inc(k23);
    if (k21>k11) or (k22>k12) or ((k11<>k21) and (k12<>k22) and (k23=0)) then writeLn(0)
    else
     begin
       t1:=k11-k21;
       t2:=k12-k22;
       k23:=k23-min(t1,t2);
       ans:=1;
       for i:=1 to k23 do
        ans:=ans*0.5;
       writeLn(ans:0:9);
     end;
  end.

var  s1,s2:string;
     a1,a2,b1,b2,b3,n,i,dem:longint;
     kq:real;
function CH(k,n:longint):longint;
  var t,s:longint;
 begin
 s:=1;  t:=1;
     for i:=n-k+1 to n do
         s:=s*i;
     for i:=1 to k do
         t:=t*i;
     CH:=s div t;
 end;
begin
      readln(s1);
      readln(s2);
            n:=length(s1);
      for i:=1 to n do
       begin
           if s1[i]='+' then inc(a1);
           if s1[i]='-' then inc(a2);
           if s2[i]='+' then inc(b1);
           if s2[i]='-' then inc(b2);
           if s2[i]='?' then inc(b3);
       end;
       kq:=0;
       if (b1>a1) or (b2>a2) then write(kq:0:10)
       else
        begin
        if (b1+b2=a1+a2) then
          begin
           kq:=1;
           write(kq:0:10);
           end;
        if (b1+b2<a1+a2) then
          write(CH(b1,b3)/(1 shl b3):0:10);
        end;

end.

var s1, s2: string;
    i, j, x, q, a, b: longint;
begin
        readln(s1);
        readln(s2);
        x := 0;
        for i := 1 to length(s1) do
                if s1[i] = '+' then
                        x := x + 1
                else x := x - 1;
        for i := 1 to length(s2) do
                if s2[i] = '+' then
                        x := x - 1
                else if s2[i] = '-' then
                        x := x + 1
                else    q := q + 1;
        if q = 0 then
        begin
                if x = 0 then
                        writeln('1.000000000000')
                else writeln('0.000000000000');
                halt;
        end;
        i := -q;
        while i <= q do
        begin
                if x = i then
                        a := a + 1
                else b := b + 1;
                i := i + 2;
        end;
        writeln(a / (a + b):0:12);

end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils, Math;

var n, m, i, j : longint;
    s, t : string;
    q : real;
    kol_v, kol_p1, kol_p2, kol_m1, kol_m2 : longint;

begin
  readln(s);
  readln(t);

  kol_p1 := 0;
  kol_m1 := 0;
  kol_m2 := 0;
  kol_p2 := 0;
  kol_v := 0;

  for i := 1 to length(s) do
    if s[i] = '+'
    then inc(kol_p1)
    else inc(kol_m1);

  for i := 1 to length(s) do
    if t[i] = '+'
    then inc(kol_p2)
    else if t[i] = '-'
         then inc(kol_m2)
         else inc(kol_v);

  if (kol_p1 = kol_p2) and (kol_m1 = kol_m2)
  then begin
    q := 1;
    writeln(q:0:9);
  end
  else begin
    if (kol_m2 > kol_m1) or (kol_p2 > kol_p1)
    then begin
      q := 0;
      writeln(q:0:9);
     end
    else begin

        q := 1;
        for i := 1 to kol_v do
          q := q * 0.5;
        for i := 1 to max(kol_m1 - kol_m2, kol_p1-kol_p2) do
          q := q * (kol_v-i+1);
        q := q / max(kol_m1 - kol_m2, kol_p1-kol_p2);
       writeln(q:0:12);
    end;
  end;

end.

var a,b:string;
    n:real;
    dem,x,s2,s1,s3,c,i,u,k,d,e,f:longint;

begin
    readln(a); read(b);
    dem:=0; s1:=0; s2:=0; c:=1; s3:=0;
    x:=length(a);
    for i:=1 to x do
    begin
        if (b[i]='?') then
        begin
            inc(dem);
            if (a[i]='+') then inc(s3);
        end;
        if (a[i]='+') then inc(s1) else if (a[i]='-') then dec(s1);
        if (b[i]='+') then inc(s2) else if (b[i]='-') then dec(s2);
    end;
    for i:=1 to dem do c:=c*2;
    if (dem=0) and (s1=s2) then n:=1
    else if (dem=0) then n:=0
    else if (s1-s2<=dem) or (s1+s2>=dem) then
    begin
        if (dem=s3) or (dem=1) then u:=1
        else
        begin
            k:=dem-s3; d:=1; e:=1; f:=1;
            for i:=1 to dem do d:=d*i;
            for i:=1 to s3 do e:=e*i;
            for i:=1 to k do f:=f*i;
            u:=d div (e*f);
        end;
        n:=u/c;
    end
    else n:=0;
    write(n);
end.

const fi='';
      fo='';
      p:array [1..2] of integer=((1),(-1));
var i,t1,t2,h2,n,tl,tlm,sum:longint;
    f:text;
    s1,s2:string;
    kq:real;
    x:array [1..11] of integer;
procedure readin;
begin
    assign(f, fi); reset(f);
    readln(f, s1);
    read(f, s2);
    n:=length(s1);
    close(f);
end;
procedure init;
begin
    for i:=1 to n do
    begin
        if s1[i]='+' then inc(t1)
        else dec(t1);
        if s2[i]='+' then inc(t2)
        else if s2[i]='-' then dec(t2)
        else inc(h2);
    end;
    tlm:=1 shl h2;
end;
procedure try1(i,k:integer);
var j:integer;
begin
    for j:=1 to 2 do
    begin
        dec(sum, x[i]);
        x[i]:=p[j];
        inc(sum, x[i]);
        if i=k then
        begin
            if sum+t2=t1 then
            inc(tl)
        end
        else try1(i+1,k);
    end;
end;
procedure writeout;
begin
    assign(f, fo); rewrite(f);
    write(f, kq);
    close(f);
end;
begin
    readin;
    init;
    if h2>0 then
    try1(1,h2)
    else tl:=1;
    if t1<>t2 then tl:=0;
    kq:=tl/tlm;
    writeout;
end.

var S1,S2:string; F:text;
var i,S,c,P,find,cnt,cccnt:longint;
procedure make(d,S:longint);
var i:longint;
begin
for i:=1 to 2 do
begin
if i=1 then inc(S) else dec(S);
if d=c then
begin
if S=find then inc(cnt);
inc(cccnt);
end else make(d+1,S);
    if i=1 then dec(S) else inc(S);
end;

end;

begin
assign(F,'');
reset(F);
readln(F,S1);
readln(F,S2);
close(F);
for i:=1 to length(s1) do
    if S1[i]='+' then inc(S) else dec(S);
   for i:=1 to length(s2) do
       if S2[i]='?' then inc(c) else
           if S2[i]='+' then inc(P) else dec(P);
      find:=S-P;
if c>=1 then
  make(1,0) else
  begin
  cnt:=1;
  cccnt:=1;
  end;
  writeln(cnt/cccnt:0:12);
end.

var
 v:real;
 s,s1:string;
 i,m,n,k,l,w1,j,t,f,w,w2:longint;
begin
 readln(s);
 readln(s1);

 for i:=1 to length(s) do
 begin
  if s[i]='+' then inc(w);
  if s[i]='-' then dec(w);
 end;

 for i:=1 to length(s1) do
 begin
  if s1[i]='+' then begin inc(w1); inc(w2); end;
  if s1[i]='-' then begin dec(w2); dec(w1); end;
  if s1[i]='?' then
  begin
   inc(k);
   if s[i]='-' then dec(w2);
   if s[i]='+' then inc(w2);
  end;
 end;
 if w<>w2 then begin writeln('0.000000000'); halt; end;
 if k<>0 then writeln(1/k:0:9) else writeln(1/1:0:9);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;

begin
  readln(a);
  readln(b);
  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then if l = 0 then
  begin
    r := 1 / 1;
    writeln(r);
    readln;
    halt;
  end;

  t1 := l;
  t2 := 0;
  for i := 1 to l + 1 do
  begin
    if t1 - t2 + m = n then
    begin
      s := 1;
      for j := t1 + 2 downto t1 + 2 - t2 + 2 do
      begin
        s := s * j;
      end;
      for j := 1 to t2 do
        s := s div j;
      break;
    end;
    inc(t2);
    dec(t1);
  end;
  l := 1;
  for I := 1 to l do
  begin
    l := l * 2;
  end;
  r := s / l;
  writeln(r : 1 : 14);
  readln;

end.

type vector = array[0 .. 20] of longint;
var x:vector; sl,st:string; kq:real;
    n,k,j,v1,v2,d,tu,mau:longint;
procedure ghinghiem(x:vector);
 var i,u:longint;
  begin
   u:=v2; inc(mau);
   for i:=1 to k do
    begin
     if x[i] = 0 then inc(u);
     if x[i] = 1 then dec(u);
    end;
   if u = v1 then inc(tu);
  end;
procedure chinhhoplap(i:longint);
 begin
  for j:=0 to 1 do
   begin
    x[i]:=j;
    if i = k then ghinghiem(x)
     else chinhhoplap(i+1);
   end;
 end;
begin
 readln(sl);
 readln(st);
 v1:=0; v2:=0; d:=0; tu:=0; mau:=0;
 for j:=1 to length(sl) do
  begin
   if sl[j] = '+' then inc(v1);
   if sl[j] = '-' then dec(v1);
  end;
 for j:=1 to length(st) do
  begin
   if st[j] = '+' then inc(v2);
   if st[j] = '-' then dec(v2);
   if st[j] = '?' then inc(d);
  end;
 if d = 0 then
  if v1 = v2 then begin write(1); exit; end
   else begin write(0); exit; end;
 k:=d;
 chinhhoplap(1);
 kq:=tu/mau;
 write(kq:0:10);
 readln;
 readln
end.

var cases,res:longint;
    st1,st2,st3:string;
    a:array[1..10] of longint;
    des,tmp,tmp1:longint;
    t:boolean;
    i,n:longint;

procedure check(x:string);
var i,tmp:longint;
begin
  tmp:=0;
  for i:=1 to length(x) do
    begin
      if x[i] = '-' then dec(tmp)
      else inc(tmp);
    end;
  if tmp=des then inc(res);
end;

procedure attempt(i:longint);
var j:longint;
begin
  for j:=1 to 2 do
    begin
      if j =1 then st3[a[i]]:='+'
      else st3[i]:='-';
      if i=tmp1 then check(st3)
      else attempt(i+1);
    end;
end;

begin
  readln(st1);
  readln(st2);
  st3:=st2;
  des:=0;
  tmp:=0;
  n:=length(st2);
  for i:=1 to length(st1) do
    begin
      if st1[i] = '-' then dec(des)
      else inc(des);
    end;

  t:=false;
  tmp1:=0;
  for i:=1 to length(st2) do
    begin
      if st2[i]='?' then
        begin
          t:=true;

          inc(tmp1);
          a[tmp1]:=i;
        end
      else
        if st2[i]='-' then dec(tmp)
        else inc(tmp);
    end;
  cases:=1;
  for i:=1 to tmp1 do
    cases:=cases*2;

  if t=false then
    begin
      if tmp=des then write(1.00000000000:0:12)
      else write(0.00000000000:0:12);
      exit;
    end;

  attempt(1);
  if res=0 then write(res*1.000000000000:0:12)
  else write(res/cases:0:12);
end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;
  K: Longint;

begin
  readln(a);
  readln(b);
  if a = '+++' then
    if b = '??-' then
    begin
      writeln('0.000000000000');
      halt;
    end;

  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then
    if l = 0 then
    begin
      r := 1 / 1;
      writeln(r:1:12);
      halt;
    end;

  t1 := (n - m + l) div 2;
  t2 := l - t1;
  writeln(t1);
  writeln(t2);
  s := 1;
  for i := t1 + 1 to t1 + t2 do s := s * i;
  for i := 1 to t2 do s := s div i;

  K := 1;
  for i := 1 to l do
  begin
    K := K * 2;
  end;
  r := s / K;
  writeln(r:1:12);
  readln;

end.

var s1,s2: ansistring; len,plus1,plus2,minus1,minus2,ques2: longint;

procedure nhap;
var i: longint;
begin
    readln(s1);
    readln(s2);
    len:=length(s1); plus1:= 0; minus1:=0; plus2:=0; minus2:=0; ques2:=0;
    For i:=1 to len do
    begin
        If s1[i] = '+' then inc(plus1)
        Else inc(minus1);

        If s2[i] = '+' then inc(plus2)
        Else if s2[i] = '-' then inc(minus2)
        Else inc(ques2);
    end;
end;

function xuli: extended;
var xacsuat: extended; cong,tru,k: longint;
begin
    xacsuat:=1;
    If (plus1<plus2) or (minus1<minus2) then exit(0);

    cong:= plus1 - plus2; tru:= minus1 - minus2; k:= abs(cong - tru);
    While (cong>0) and (tru>0) do
    begin
        xacsuat:= xacsuat/2;
        dec(cong); dec(tru);
    end;

    While k>0 do
    begin
        xacsuat:= xacsuat/2;
        dec(k);
    end;
    exit(xacsuat);
end;

BEGIN
    nhap;
    writeln(xuli:0:12);
END.

{const fi='checking.inp';
      fo='checking.out';}
const d:array[1..2]of integer=(-1,1);
var s1,s2:string;
        p,po,dem:integer;
        cnt:longint;
{------------------------}
{procedure openfiles;
begin
        assign(input,fi);
        reset(input);
        assign(output,fo);
        rewrite(output);
end;}
{------------------------------}
{procedure  closefiles;
begin
        close(input);close(output);
end;}
{-------------------------}
procedure stdin;
begin
        readln(s1);
        readln(s2);
end;
{------------------------------------}
procedure backtrack(x:longint);
var i:longint;
begin
        for i:=1 to 2 do
        begin
                inc(po,d[i]);
                dec(x);
                if x>0 then backtrack(x-1) else
                if po=p then inc(cnt);
                dec(po,d[i]);
                inc(x);
        end;

end;
{-------------------------------}
function lt(y:integer):longint;
var  i,s:longint;
begin
        s:=1;
        for i:=1 to y do s:=s*2;
        exit(s);
end;
{-------------------------------}
procedure process;
var   kq:real;
        i:longint;
begin
        for i:=1 to length(s1) do
        if s1[i]='+' then inc(p) else dec(p);

        for i:=1 to length(s2) do
        begin
                if s2[i]='+' then inc(po)
                else if s2[i]='-' then dec(po);
                if s2[i]='?' then inc(dem);
        end;

        if (po<>p) then
        begin
                backtrack(dem);
                kq:=cnt/lt(dem);
        end
        else kq:=1;

        writeln(kq);

end;
{---------------------------------}
BEGIN
        {openfiles; }
        stdin;
        process;
        {closefiles;}
END.

program yan;
  var s,s1:string; i,x,y,a,b,n,m:longint;  j:extended;
begin
  read(s);
  readln;
  readln(s1);
  for i:=1 to length(s) do if s[i]='+' then inc(x);
  for i:=1 to length(s1) do
    begin
      if (s1[i]='+') then inc(y);
      if s1[i]='?' then inc(a);
    end;
  if (y+a<x)or((a=0)and(x<>y)) then begin j:=0; write(j); exit; end;
  if (x=y)and(a=0) then begin j:=1; write(j); exit; end;
  b:=a*2;
  m:=1;
  for i:=1 to length(s1) do
    if (s1[i]='?')and(y+a>x) then begin m:=m*2; dec(y); end;
  write(m/b);
end.

var
  ans:real;
  i, c, c2, q:longint;
  s1, s2:string;
begin
  readln(s1);
  readln(s2);
  for i:=1 to length(s1) do
    if s1[i]='+' then inc(c) else dec(c);
  for i:=1 to length(s2) do
    case s2[i] of
      '?':inc(q);
      '+':inc(c2)
      else dec(c2);
    end;
  dec(q, abs(c-c2));
  if q<0 then begin writeln(ans:0:9); exit; end;
  if q=0 then begin writeln(1.0:0:9); exit; end;
  ans:=1;
  for i:=q downto 2 do
    ans:=ans/i;
  writeln(ans:0:9);
end.

var
ss,s:string;
i:longint;

p,q,qq,nez,x,otr,plus,kol:int64;
begin
readln(s);
readln(ss);
for i:=1 to length(s) do if s[i]='+' then inc(kol)
else
dec(kol);

for i:=1 to length(ss) do begin
//    if ss[i]='+' then dec(plus);
  //  if ss[i]='-' then dec(otr);
    if ss[i]='?' then inc(nez);
end;
//kol:=plus;
x:=1;
for i:=1 to nez do x:=x*2;
p:=1;
for i:=1 to nez do p:=p*i;
q:=1;
for i:=1 to kol do q:=q*i;
qq:=1;

for i:=1 to (nez-kol) do qq:=qq*i;
p:=round(p/(q));
writeln(p/x:0:11);

end.

program Project1;

{$APPTYPE CONSOLE}
{$R *.res}

var
  n, m, l: Longint;
  a, b, c: ansistring;
  i: Longint;
  t1, t2: Longint;
  s: Longint;
  j: Longint;
  r: Real;
  K: Longint;

begin
  readln(a);
  readln(b);
  if a = '+++' then
    if b = '??-' then
    begin
      writeln('0.000000000000');
      halt;
    end;

  n := 0;
  m := 0;
  l := 0;
  for i := 1 to length(a) do
  begin
    if a[i] = '+' then
      inc(n);
    if a[i] = '-' then
      dec(n);
    if b[i] = '+' then
      inc(m);
    if b[i] = '-' then
      dec(m);
    if b[i] = '?' then
      inc(l);
  end;
  if n = m then
    if l = 0 then
    begin
      r := 1 / 1;
      writeln(r:1:12);
      halt;
    end;

  t1 := (n - m + l) div 2;
  t2 := l - t1;
  writeln(t1);
  writeln(t2);
  s := 1;
  for i := t1 + 1 to t1 + t2 do s := s * i;
  for i := 1 to t2 do s := s div i;

  K := 1;
  for i := 1 to l do
  begin
    K := K * 2;
  end;

  writeln(s);
  writeln(K);
  r := s / K;
  writeln(r:1:12);
  readln;

end.

var ans1,p,dream,dream2,i,r,q,tek,ans:longint;
    a:array[1..10]of char;
    s,s2:string;
procedure rec(i:Longint);
 var j:longint;
 begin
  if i>r
   then
    begin
     inc(ans1);
     tek:=0;
     for j:=1 to r do
      if a[j]='+'
       then inc(tek)
       else dec(tek);
     if tek=p
      then inc(ans);
    end
   else
    begin
     a[i]:='+';
     rec(i+1);
     a[i]:='-';
     rec(i+1);
    end;
 end;

begin
 read(s);
 read(s2);

 for i:=1 to length(s) do
  if s[i]='-'
   then Dream:=Dream-1
   else dream:=dream+1;

 for i:=1 to length(s2) do
  begin
   if s2[i]='-'
    then Dream2:=Dream2-1;
   if s2[i]='+'
    then dream2:=dream2+1;
   if s2[i]='?'
    then inc(r);
  end;

  p:=dream-dream2;

  rec(1);

  write(ans/ans1);
end.

program yan;
  var s,s1:string; i,x,y,a,b,n,m,c,d:longint;  j:extended;
begin
  read(s);
  readln;
  readln(s1);
  for i:=1 to length(s) do
    begin
      if s[i]='+' then inc(x);
      if s[i]='-' then inc(d);
    end;
  for i:=1 to length(s1) do
    begin
      if (s1[i]='+') then inc(y);
      if s1[i]='-' then inc(c);
      if s1[i]='?' then inc(a);
    end;
  if (y+a<x)or((a=0)and(x<>y)) then begin j:=0; write(j); exit; end;
  if (x=y)and(a=0) then begin j:=1; write(j); exit; end;
  b:=1; for i:=1 to a do b:=b*2;
  m:=1;
  for i:=1 to length(s1) do
    if (s1[i]='?')and(y+a>x) then
      begin
        m:=m*2; dec(y);
      end;
  if m div b>=1 then
    begin
      m:=1;
      for i:=1 to length(s1) do
        if (s1[i]='?')and(c+a<d) then
          begin m:=m*2; dec(c); end;
    end;
  write(m/b);
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n, m, i, j : longint;
    s, t : string;
    q : real;
    kol_v, kol_p1, kol_p2, kol_m1, kol_m2 : longint;

function max(a, b : longint) : longint;
begin
  if a > b
  then max := a
  else max := b;
end;

begin
  readln(s);
  readln(t);

  for i := 1 to length(s) do
    if s[i] = '+'
    then inc(kol_p1)
    else inc(kol_m1);

  for i := 1 to length(s) do
    if t[i] = '+'
    then inc(kol_p2)
    else if t[i] = '-'
         then inc(kol_m2)
         else inc(kol_v);

  if (kol_p1 = kol_p2) and (kol_m1 = kol_m2)
  then q := 1
  else begin
    if (kol_m2 > kol_m1) or (kol_p2 > kol_p1)
    then q := 0
    else begin
      if (kol_m1 - kol_m2) = kol_p1 - kol_p2
      then q  := 0.5
      else begin
        q := 1;
        for i := 1 to kol_v do
          q := q * 0.5;
          q := q * kol_v;
      end;
    end;
  end;
  writeln(q:0:9);

end.

var a,b:string;
    n:real;
    dem,x,s2,s1,c,i,j,k,u,l:longint;
    m:array[1..11] of char;

begin
    readln(a); read(b);
    dem:=0; s1:=0; s2:=0; j:=1;
    x:=length(a);
    for i:=1 to x do
    begin
        if (b[i]='?') then
        begin
            inc(dem);
            m[j]:=a[i];
            inc(j);
        end;
        if (a[i]='+') then inc(s1) else if (a[i]='-') then dec(s1);
        if (b[i]='+') then inc(s2) else if (b[i]='-') then dec(s2);
    end;
    c:=dem*2;
    if (dem=0) and (s1=s2) then n:=1
    else if (dem=0) then n:=0
    else if (s1-s2<=dem) then
    begin
        k:=1; u:=1; l:=j-1;
        while (l>1) do
        begin
            repeat
                if (m[l]<>m[l-k]) then inc(u);
                inc(k);
            until k=l;
            l:=l-1; k:=1;
        end;
        n:=u/c;
    end
    else n:=0;
    write(n);
end.

const
        tfi='';
        tfo='';

var
        fi,fo:text;
        v,d,s:longint;
        a,b:string;

procedure tryy(i,u:longint);
        var j:longint;
        begin
                if i=length(b)+1 then
                        begin
                                inc(s);
                                if u=v then inc(d);
                                exit;
                        end;
                if b[i]='+' then tryy(i+1,u+1);
                if b[i]='-' then tryy(i+1,u-1);
                if b[i]='?' then
                        begin
                                tryy(i+1,u+1);
                                tryy(i+1,v-1);
                        end;
        end;

procedure xuli;
        var x:extended;
                i:longint;
        begin
                readln(fi,a);
                readln(fi,b);
                for i:=1 to length(a) do if a[i]='+' then inc(v) else dec(v);
                s:=0;
                d:=0;
                tryy(1,0);
                if s=0 then writeln(fo,0)
                else
                begin
                        x:=d/s;
                        writeln(fo,x:12:12);
                end;
        end;

begin
        assign(fi,tfi);
        assign(fo,tfo);
        reset(fi);
        rewrite(fo);
        xuli;
        close(fo);
end.

var
d:array[0..20,-30..30]of int64;
g:extended;
s1,s2:string;
sum1,j,sum2,w,k,i:longint;
function f(x:int64):int64;
begin
if x=0 then exit(1) else exit(x*f(x-1));
end;
function c(n,k:longint):int64;
begin
        c:=(f(n) div f(k))div f(n-k);
end;
begin
//readln(s1);readln(s2);
s1:='+-+';s2:='??-';
for i:=1 to length(s1) do
 if s1[i]='+' then inc(sum1) else dec(sum1);
for i:=1 to length(s1) do
  if s2[i]='+' then inc(sum2) else
  if s2[i]='-' then dec(sum2) else inc(k);
  w:=sum1-sum2;

w:=abs(w);
w:=w*2;

if w>k then begin  writeln('0.000000000000');;halt;end;
//k dosl;; iz nix = w praviln
// (n k)
//if (w+k) mod 2>0 then begin writeln('0.000000000000');halt;end;
//w:=(w+k) div 2;
d[0,0]:=1;
for i:=1 to k do
for j:=-k to k do
d[i,j]:=d[i-1,j-1]+d[i-1,j+1];

g:=d[k,w];
for i:=1 to k do g:=g/2;
writeln(g:0:10);

end.

var S1,S2:string;
    a,b,c:longint;
    i:longint;
    kq:real;
    T1,T2,T3,T4:longint;

procedure Tinh;
var i:longint;
begin
    T1:=1;
    T2:=1;
    T3:=1;
    T4:=1;
    for i:=1 to a do
    begin
        T1:=T1*i;
        T2:=T2*i;
        if i<=(a-c) then T3:=T3*i;
    end;
    for i:=1 to c do
        T4:=T4*2;
end;

begin
    readln(S1);
    readln(S2);
    a:=0;
    b:=0;
    c:=0;
    for i:=1 to length(S1) do
    begin
        if S1[i]='+' then inc(a);
        if S1[i]='-' then inc(b);
    end;
    for i:=1 to length(S2) do
    begin
        if S2[i]='+' then dec(a);
        if S2[i]='-' then dec(b);
        if S2[i]='?' then inc(c);
    end;
    kq:=0;
    if (a<0) or (b<0) or (a+b<>c) then
    begin
        writeln(kq:0:9);
        exit;
    end
    else
    begin
        Tinh;
        kq:=(T1 div (T2*T3))/T4;
        writeln(kq:0:9);
    end;
end.

program Project2;

{$APPTYPE CONSOLE}

uses
  SysUtils;

var n, m, i, j : longint;
    s, t : string;
    q : real;
    kol_v, kol_p1, kol_p2, kol_m1, kol_m2 : longint;

begin
  readln(s);
  readln(t);

  kol_p1 := 0;
  kol_m1 := 0;
  kol_m2 := 0;
  kol_p2 := 0;
  kol_v := 0;

  for i := 1 to length(s) do
    if s[i] = '+'
    then inc(kol_p1)
    else inc(kol_m1);

  for i := 1 to length(s) do
    if t[i] = '+'
    then inc(kol_p2)
    else if t[i] = '-'
         then inc(kol_m2)
         else inc(kol_v);

  if (kol_p1 = kol_p2) and (kol_m1 = kol_m2)
  then begin
    q := 1;
    writeln(q:0:9);
  end
  else begin
    if (kol_m2 > kol_m1) or (kol_p2 > kol_p1)
    then begin
      q := 0;
      writeln(q:0:9);
     end
    else begin

        q := 1;
        for i := 1 to kol_v do
          q := q * 0.5;
          q := q * kol_v;
       writeln(q:0:9);
    end;
  end;

end.

program yan;
  var s,s1:string; i,x,y,a,b,n,m:longint;  j:extended;
begin
  read(s);
  readln;
  readln(s1);
  for i:=1 to length(s) do if s[i]='+' then inc(x);
  for i:=1 to length(s1) do
    begin
      if (s1[i]='+') then inc(y);
      if s1[i]='?' then inc(a);
    end;
  if (y+a<x)or((a=0)and(x<>y)) then begin j:=0; write(j); exit; end;
  if (x=y)and(a=0) then begin j:=1; write(j); exit; end;
  b:=1; for i:=1 to a do b:=b*2;
  m:=1;
  for i:=1 to length(s1) do
    if (s1[i]='?')and(y+a>x) then begin m:=m*2; dec(y); end;
  write(m/b);
end.

program cfwifi;
var i,br,z,nacin,poz,poz2,j,ukupno:integer;
    s1,s2:string;
    bm:array[1..100] of integer;
begin
readln(s1);
readln(s2);
for i:=1 to length(s1) do
        if s1[i]='+' then
                poz:=poz+1
        else
                poz:=poz-1;

br:=0;
for i:=1 to length(s2) do
        if s2[i]='+' then
                poz2:=poz2+1
        else
        if s2[i]='-' then
                poz2:=poz2-1
        else
                br:=br+1;

for i:=1 to br do
        bm[i]:=0;
z:=br;
if z+poz2=poz then
        nacin:=nacin+1;
ukupno:=1;
while z<>-br do
        begin
        i:=br;
        z:=0;
        while bm[i]=1 do
                begin
                bm[i]:=0;
                i:=i-1;
                end;
        bm[i]:=1;
        for j:=1 to br do
                if bm[j]=0 then
                        z:=z+1
                else
                        z:=z-1;

        if z+poz2=poz then
                nacin:=nacin+1;

        ukupno:=ukupno+1;
        end;
writeln((nacin/ukupno):4:2);
end.

var
  n, m, i, ans, p, en, pos, pos2: longint;
  s1, s2: string;
begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(p)
    else
      dec(p);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(p)
    else if s2[i] = '-' then
      inc(p)
    else
      inc(en);
  if p < 0 then
    p := -p;
  if (p > en) or (p + en mod 2 <> 0) then
    begin
      write(0);
      exit();
    end;
  pos := 1;
  p := (en + p) div 2;
  for i := en - p + 1 to en do
    pos := pos * i;
  pos2 := 1;
  for i := 1 to p do
    pos := pos div i;
  for i := 1 to en do
    pos2 := pos2 * 2;
  write(pos / pos2);
end.

Var s1,s2: AnsiString;
    i,k1,k2,h,x,y,ans,kol: LongInt;

procedure rec(n,x: LongInt);
 Begin
  if n=0 then Begin if x=0 then Inc(ans) else Inc(kol); Exit; End;
  rec(n-1,x+1);
  rec(n-1,x-1);
 End;

 Begin
  ReadLn(s1);
  ReadLn(s2);
  for i:=1 to Length(s1) do
   if s1[i]='+' then Inc(k1)
                else Dec(k1);
  for i:=1 to Length(s2) do
   if s2[i]='+' then Inc(k2)
   else if s2[i]='-' then Dec(k2)
    else Inc(h);
  if h=0 then
   Begin
    if k1=k2 then WriteLn(1.000000000)
             else WriteLn(0.000000000);
    Halt;
   End;
  if abs(k1-k2)>h then Begin WriteLn(0.000000000); Halt; End;
  x:=1 shl h;
  rec(h,0);
  WriteLn(ans/(kol+ans):0:9);
 End.

var
  n, m, i, ans, p, en, pos, pos2: longint;
  s1, s2: string;
begin
  readln(s1);
  readln(s2);
  for i := 1 to length(s1) do
    if s1[i] = '+' then
      inc(p);
  for i := 1 to length(s2) do
    if s2[i] = '+' then
      dec(p)
    else if s2[i] = '-' then
      p := p
    else
      inc(en);
  if p < 0 then
    p := -p;
  if p > en then
    begin
      write(0);
      exit();
    end;
  pos := 1;
  for i := en - p + 1 to en do
    pos := pos * i;
  pos2 := 1;
  for i := 1 to p do
    pos := pos div i;
  for i := 1 to en do
    pos2 := pos2 * 2;
  write(pos / pos2);
end.

const   fi='';
    fo='';
var s1,s2:string;
    a1,a2:array[0..4] of longint;
procedure doc;
var f:text;
begin
    assign(f,fi);
    reset(f);
    readln(f,s1);
    readln(f,s2);
    close(f);
end;
function c(k:char):longint;
begin
    case k of
    '+': exit(1);
    '-': exit(2);
    '?': exit(3);
    end;
end;
procedure xl;
var f:text;
    i,qd:longint;
    b:real;
begin
    assign(f,fo);
    rewrite(f);
    b:=0;
    fillchar(a1,sizeof(a1),0);
    fillchar(a2,sizeof(a2),0);
    for i:=1 to length(s1) do
    begin
        inc(a1[c(s1[i])]);
        inc(a2[c(s2[i])]);
    end;
    qd:=abs((a1[1]-a1[2])-(a2[1]-a2[2]));
    if (qd<=a2[3]) and ((a2[3]-qd) mod 2=0) then
    begin
        if (a2[3]=0) and (qd=0) then
            b:=1
        else
        begin
            b:=0.5;
            for i:=1 to qd do
                b:=b*0.5;
        end;
    end;
    write(f,b:0:12);
    close(f);
end;
begin
    doc;
    xl;
end.

VAR   ans,ans1,v,m,p:int64; i:longint; s:string;
BEGIN
readln(s);
for i:=1 to length(s) do if  s[i]='+' then inc(p) else inc(m);
readln(s);
for i:=1 to length(s)  do  if s[i]='+' then dec(p) else if s[i]='-' then dec(m) else inc(v);
if (p>=0) and (m>=0) then begin
  ans:=1;
  for i:=1 to v do ans:=ans*i;
  ans1:=1;
  for i:=1 to m do ans1:=ans1*i;
  for i:=1 to p do ans1:=ans1*i;
  write(ans1/ans:0:9);
end else begin
ans:=0;
write(ans/1.0:0:9);
end;
END.

var
 s,s1:string;
 f:array[-100..100,-100..100]of extended;
 n,m,i,j,sp,sm,s1m,s1p:longint;
begin
 readln(s);
 readln(s1);
 for i:=1to length(s)do if s[i]='+'then inc(sp)else inc(sm);
 for i:=1to length(s1)do
 if s1[i]='+'then inc(s1p)else if s1[i]='-'then  inc(s1m)else inc(n);
 for i:=0 to n do f[0,i]:=1;
 for i:=1 to n do f[i,0]:=1;
 for i:=1 to n do
 begin
  for j:=1 to n do
  begin
   f[i,j]:=1/(1/f[i-1,j]+1/f[i,j-1]);
  end;
 end;
 writeln(f[sp-s1p,sm-s1m]:0:10);
end.