#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  string ss;
  cin >> ss;
  long long cntps1 = 0, cntng1 = 0, cntps2 = 0, cntng2 = 0, nm = 0, nm2 = 0;
  for (long long i = 0; i < s.size(); i++) {
    if (s[i] == '+') {
      cntps1++;
      nm++;
    } else if (s[i] == '-') {
      cntng1++;
      nm--;
    }
    if (ss[i] == '+') {
      cntps2++;
      nm2++;
    } else if (ss[i] == '-') {
      cntng2++;
      nm2--;
    }
  }
  bool bl = true;
  if ((cntps2 > cntps1) || (cntng2 > cntng1)) {
    bl = false;
  }
  long long mrk = s.size() - (cntps2 + cntng2), mrkk = mrk,
            idk = cntps1 - cntps2, idkk = mrk - idk;
  long long tmp = 1, tmp2 = 1, tmp3 = 1;
  if (mrk == 0 && nm != nm2) {
    bl = false;
  }
  while (mrk > 0) {
    tmp *= mrk;
    mrk--;
  }
  while (idk > 0) {
    tmp2 *= idk;
    idk--;
  }
  while (idkk > 0) {
    tmp3 *= idkk;
    idkk--;
  }
  double ans = tmp / (tmp2 * tmp3);
  ans /= pow(2, mrkk);
  if (bl == false) {
    cout << fixed << setprecision(12) << 0.000000000000;
  } else {
    cout << fixed << setprecision(12) << ans;
  }
}
