#include <bits/stdc++.h>
using namespace std;
int main() {
  int n, a = 0, b = 0, x = 0, y = 0;
  double ans = 0;
  string s1, s2;
  cin >> s1 >> s2;
  n = s1.size();
  for (int i = 0; i < n; i++) {
    if (s1[i] == '+') a++;
    if (s2[i] == '+') b++;
    if (s2[i] == '?') x++;
  }
  cout << fixed << setprecision(9);
  if (x + b < a || n - a > n - b)
    ans = 0;
  else if (a == b && n - a == n - b - x)
    ans = 1;
  else {
    ans = 1;
    a -= b;
    for (int i = x; i > 0; i--) {
      ans *= 0.5;
    }
    for (int i = 1; i <= a; i++) {
      ans *= 1.0 * x / i;
      x--;
    }
  }
  cout << ans;
  return 0;
}
