#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
int cc(int m, int n) {
  int ans = 1, ans2 = 1;
  for (int i = n, j = 1; j <= m; j++, i--) {
    ans *= i;
  }
  for (int i = 1; i <= m; i++) {
    ans2 *= i;
  }
  return ans / ans2;
}
int main(void) {
  string a, b;
  int ans1 = 0, ans2 = 0, ans3 = 0, ans4 = 0;
  cin >> a >> b;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '+') ans1++;
    if (b[i] == '+')
      ans2++;
    else if (b[i] == '?')
      ans3++;
  }
  ans4 = ans1 - ans2;
  if (ans4 < 0) {
    cout << "0" << endl;
  } else {
    int gg = cc(ans4, ans3);
    int jj = pow(2, ans3);
    double ww = gg * 1.0 / jj;
    printf("%.9lf\n", ww);
  }
  return 0;
}
