#include <bits/stdc++.h>
using namespace std;
int majidp;
int BMM(int a, int b) {
  if (a % b == 0) return b;
  return BMM(b, a % b);
}
int main() {
  string s1, s2;
  int f;
  cin >> s1 >> s2;
  int x1 = 0;
  int x2 = 0;
  int i, j;
  int cnt = 0;
  double ans = 1.0;
  for (i = 0; i < s1.length(); i++) {
    if (s1[i] == '+')
      x1++;
    else
      x1--;
  }
  for (i = 0; i < s2.length(); i++) {
    if (s2[i] == '+')
      x2++;
    else if (s2[i] == '-')
      x2--;
    else
      cnt++;
  }
  int delta = x2 - x1;
  if (delta < 0) delta = -delta;
  if (cnt < delta || (cnt - delta) & 1) {
    cout << 0 << endl;
    return 0;
  }
  f = cnt;
  int k = delta + (cnt - delta) / 2;
  for (i = 1; i <= (f - k); i++) {
    ans = ans * (k + i);
    ans = ans / i;
  }
  for (i = 1; i <= f; i++) {
    ans /= 2.0;
  }
  printf("%.12lf\n", ans);
  return 0;
}
