#include <bits/stdc++.h>
using namespace std;
long long fact(long long n) {
  if (n <= 1)
    return 1;
  else
    return n * fact(n - 1);
}
int32_t main() {
  string s, t;
  cin >> s >> t;
  long long csp = 0, csn = 0;
  long long tsp = 0, tsn = 0;
  long long n = 0;
  for (auto it : s) {
    if (it == '+')
      csp++;
    else
      csn++;
  }
  for (auto it : t) {
    if (it == '+')
      tsp++;
    else if (it == '-')
      tsn++;
    else
      n++;
  }
  csp -= tsp;
  csn -= tsn;
  if (csp > n || csn > n) {
    cout << 0 << endl;
    return 0;
  }
  if (csp == 0 && csn == 0 && n == 0) {
    cout << 1 << endl;
    return 0;
  }
  long double ans = fact(n) / (fact(csp) * fact(csn));
  ans = ans / (pow(2, n) * 1.0);
  cout << fixed << showpoint;
  cout << setprecision(15);
  cout << ans << endl;
}
