#include <bits/stdc++.h>
using namespace std;
const int N = 1e9 + 7;
long long C(int n, int r) {
  if (r > n / 2) r = n - r;
  long long ans = 1;
  int i;
  for (i = 1; i <= r; i++) {
    ans *= n - r + i;
    ans /= i;
  }
  return ans;
}
int fact(int a) {
  int p = 1;
  for (int i = p; i >= 1; i--) {
    p = p * i;
  }
  return p;
}
int main() {
  string a, b;
  cin >> a >> b;
  int count1 = 0, count2 = 0, count3 = 0;
  cout << fixed;
  cout << setprecision(12);
  for (int i = 0; i < a.length(); ++i) {
    if (a[i] == '+') {
      count1++;
    } else {
      count1--;
    }
  }
  for (int i = 0; i < b.length(); ++i) {
    if (b[i] == '+') {
      count2++;
    } else if (b[i] == '-') {
      count2--;
    } else {
      count3++;
    }
  }
  if (count3 == 0) {
    if (count1 == count2) {
      cout << 1;
      return 0;
    } else {
      cout << 0;
      return 0;
    }
  }
  int x, y;
  if (count1 > count2 + count3 || count1 < count2 - count3) {
    cout << 0;
    return 0;
  } else {
    x = (count3 + count1 - count2) / 2;
    y = (count3 - count1 + count2) / 2;
    cout << (long double)((long double)(C(count3, x) * fact(x)) /
                          (long double)pow(2, count3));
  }
  return 0;
}
