#include <bits/stdc++.h>
using namespace std;
long fact(int a) {
  if (a == 0)
    return 1;
  else
    return a * fact(a - 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  string a, b;
  long i, l, k0, k, p, v;
  double r;
  k0 = k = v = 0;
  cin >> a >> b;
  l = a.length();
  for (i = 0; i < l; i++) {
    if (a[i] == '+')
      k0++;
    else if (a[i] == '-')
      k0--;
    if (b[i] == '+')
      k++;
    else if (b[i] == '-')
      k--;
    else if (b[i] == '?')
      v++;
  }
  p = abs(k - k0);
  if (p > v)
    r = 0;
  else if (p == 0) {
    if (v == 0) {
      if (k0 == k)
        r = 1;
      else
        r = 0;
    } else {
      if (v % 2 > 0)
        r = 0;
      else {
        p = v / 2;
        r = (double)fact(v) / (double)(fact(p) * fact(v - p) * (pow(2, v)));
      }
    }
  } else {
    p += ((v - p) / 2);
    r = (double)fact(v) / (double)(fact(p) * fact(v - p) * (pow(2, v)));
  }
  cout << fixed << setprecision(12) << r;
  return 0;
}
