#include <bits/stdc++.h>
using namespace std;
long long binpow(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
long double factorial(long double n) {
  if (n == 1 || n == 0) return 1;
  return n * factorial(n - 1);
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int n = s1.length();
  long double ans = 0, sum = 0, cnt = 0;
  for (int i = 0; i < n; i++) {
    if (s1[i] == '+') ans++;
    if (s1[i] == '-') ans--;
    if (s2[i] == '+') sum++;
    if (s2[i] == '-') sum--;
    if (s2[i] == '?') cnt++;
  }
  long double x = 0;
  if (ans - sum > cnt || ans - sum < -cnt ||
      (((int)(ans - sum)) % 2 == 0 && ((int)cnt) % 2 == 1) ||
      (((int)(ans - sum)) % 2 == 1 && ((int)cnt) % 2 == 0)) {
    cout << fixed << setprecision(12) << x;
    return 0;
  }
  long double m = (cnt + (ans - sum)) / 2;
  long double val =
      factorial(cnt) / (factorial(cnt - m) * factorial(m) * pow(2, cnt));
  cout << fixed << setprecision(12) << val;
}
