#include <bits/stdc++.h>
using namespace std;
int f[100][300] = {0};
int main() {
  std::ios::sync_with_stdio(false);
  string s1, s2;
  cin >> s1 >> s2;
  int t1 = 0, t2 = 0, q = 0;
  for (int i = 0; i < s1.length(); i += 1) {
    if (s1[i] == '+')
      t1++;
    else
      t1--;
  }
  for (int i = 0; i < s2.length(); i += 1) {
    if (s2[i] == '+')
      t2++;
    else if (s2[i] == '-')
      t2--;
    else
      q++;
  }
  int w = t1 - t2;
  int dta = 20;
  f[0][dta] = 1;
  for (int i = 1; i <= q; i += 1) {
    for (int j = -10; j <= 10; j += 1) {
      f[i][j + dta] = f[i - 1][j + dta - 1] + f[i - 1][j + dta + 1];
    }
  }
  double ans = f[q][w + dta] / double(1 << q);
  cout << fixed << setprecision(12) << ans << endl;
  return 0;
}
