#include <bits/stdc++.h>
using namespace std;
long long fact(long long n) {
  long long dp[n + 1];
  dp[0] = 1;
  for (long long i = 1; i <= n; i++) dp[i] = dp[i - 1] * i;
  return dp[n];
}
void solve() {
  string s1, s2;
  cin >> s1 >> s2;
  long long n = s1.length();
  long long c1p = 0, c1n = 0, c2p = 0, c2n = 0, c2q = 0;
  for (long long i = 0; i < n; i++) {
    if (s1[i] == '+')
      c1p++;
    else
      c1n++;
    if (s2[i] == '+')
      c2p++;
    else if (s2[i] == '-')
      c2n++;
    else
      c2q++;
  }
  long long poss = pow(2, c2q);
  long long x1 = c1p - c1n;
  long long x2 = c2p - c2n;
  float z;
  if (x1 > x2 || x1 < x2) {
    long long t = abs(x1 - x2);
    if (c2q >= t && (c2q - t) % 2 == 0) {
      z = fact(c2q) / (fact((c2q - t) / 2) * fact((c2q + t) / 2));
    } else
      z = 0;
  } else {
    if ((c2q) % 2 == 0) {
      z = fact(c2q) / (fact(c2q / 2) * fact(c2q / 2));
    } else
      z = 0;
  }
  double ans = z / (poss + 0.0);
  cout << setprecision(10) << ans << "\n";
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
