#include <bits/stdc++.h>
using namespace std;
double binomialCoeff(int n, int k) {
  double res = 1;
  if (k > n - k) k = n - k;
  for (int i = 0; i < k; ++i) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string s, s1;
  cin >> s >> s1;
  vector<int> st(3, 0);
  for (char ch : s) {
    if (ch == '+')
      st[0]++;
    else
      st[1]++;
  }
  for (char ch : s1) {
    if (ch == '+')
      st[0]--;
    else if (ch == '-')
      st[1]--;
    else
      st[2]++;
  }
  if (st[0] < 0 || st[1] < 0) {
    cout << 0;
    return 0;
  }
  int t = st[2];
  int r = st[0];
  cout.precision(10);
  cout << fixed;
  double f;
  f = binomialCoeff(t, r);
  while (t--) f = f * 0.5;
  cout << f;
  return 0;
}
