#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1e-11;
int main() {
  char dr[100], mo[100];
  long long int com[16][16];
  int pow[16];
  int lev = 0, lev1 = 0, cnt = 0;
  for (int i = 0; i <= 11; i++) {
    for (int j = 0; j <= 11; j++) {
      com[i][j] = 0;
    }
    com[i][0] = 1;
  }
  for (int i = 1; i <= 11; i++) {
    for (int j = 1; j <= i; j++) {
      com[i][j] = com[i - 1][j] + com[i - 1][j - 1];
    }
  }
  pow[0] = 1;
  for (int i = 1; i <= 15; i++) {
    pow[i] = pow[i - 1] * 2;
  }
  scanf("%s", dr);
  scanf("%s", mo);
  for (int i = 0; dr[i]; i++) {
    if (dr[i] == '+') {
      lev++;
    } else {
      lev--;
    }
  }
  for (int i = 0; mo[i]; i++) {
    if (mo[i] == '+') {
      lev1++;
    } else if (mo[i] == '-') {
      lev1--;
    } else {
      cnt++;
    }
  }
  int diff = lev - lev1;
  if (diff == 0 && cnt % 2 == 1) {
    printf("0.000000");
  } else {
    diff = abs(diff);
    if (diff > cnt) {
      printf("0.000000");
    } else {
      double ans;
      if (diff == 0) {
        ans = com[cnt][cnt / 2] / (pow[cnt] * 1.0);
        printf("%0.9f", ans);
      } else {
        cnt = cnt - diff;
        if (cnt % 2 == 1) {
          printf("0.000000");
        } else {
          ans = com[cnt + diff][diff + cnt / 2] / (pow[cnt + diff] * 1.0);
          printf("%0.9f", ans);
        }
      }
    }
  }
}
