#include <bits/stdc++.h>
using namespace std;
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  long long ans = 0, ans1 = 0, ok = 0, c = 1;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '+')
      ans++;
    else
      ans--;
  }
  for (int i = 0; i < s2.size(); i++) {
    if (s2[i] == '+')
      ans1++;
    else if (s2[i] == '-')
      ans1--;
    else
      ok++;
  }
  double answer = 0;
  if (ok == 0) {
    if (ans == ans1)
      cout << "1.000000000000";
    else
      cout << "0.000000000000";
  } else {
    if (ok < abs(ans - ans1) || (abs(ans - ans1) + ok) % 2 != 0)
      cout << 0.000000000000;
    else {
      for (int i = 0; i < (abs(ans - ans1) + ok) / 2; i++) {
        c *= ok - i;
      }
      for (int i = 2; i <= (abs(ans - ans1) + ok) / 2; i++) {
        c /= i;
      }
      printf("%.12f", (double)c / (1 << ok));
    }
  }
}
