#include <bits/stdc++.h>
const long long int MOD = 1e9 + 7;
using namespace std;
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  string a, b;
  cin >> a >> b;
  int real = 0, got = 0, cnt = 0;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == '+')
      real++;
    else
      real--;
    if (b[i] == '-')
      got--;
    else if (b[i] == '+')
      got++;
    else
      cnt++;
  }
  if (cnt < abs(got - real))
    cout << 0 << '\n';
  else {
    long long int n = cnt, r = (n - abs(got - real)) / 2;
    long long int num = 1, den = 1;
    for (int i = 1; i <= n; i++) num *= i;
    for (int i = 1; i <= n - r; i++) num /= i;
    for (int i = 1; i <= r; i++) num /= i;
    den = pow(2, n);
    long double ans = num * 1.0 / den;
    cout << setprecision(10) << std::fixed << ans << '\n';
  }
  return 0;
}
