#include <bits/stdc++.h>
using namespace std;
int main() {
  string a, b;
  cin >> a >> b;
  int pos = 0;
  int m = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] != b[i]) {
      if (b[i] == '+') {
        pos += 2;
      } else if (b[i] == '-') {
        pos -= 2;
      } else {
        m++;
        if (a[i] == '+') {
          pos--;
        } else {
          pos++;
        }
      }
    }
  }
  cout.precision(9);
  if (pos == 0 && m == 0) {
    cout << 1.0 << endl;
  } else {
    if (abs(pos) <= m && (m - abs(pos)) % 2 == 0) {
      int e = abs(pos) + (m - abs(pos)) / 2;
      double ans = pow(0.5, m);
      for (int i = 0; i < e; i++) {
        ans *= (m - i);
      }
      for (int i = 0; i < e; i++) {
        ans /= (e - i);
      }
      cout << ans << endl;
    } else {
      cout << 0.0 << endl;
    }
  }
  return 0;
}
