#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, -1, 1};
void swap(int &a, int &b) {
  int t = a;
  a = b;
  b = t;
}
int cnt1[2], cnt2[2];
int dp[13];
int main() {
  dp[0] = 1;
  for (int i = (1); i < (11); i++) dp[i] = dp[i - 1] * i;
  string s1, s2;
  cin >> s1 >> s2;
  for (int i = (0); i < (s1.size()); i++)
    if (s1[i] == '-')
      cnt1[0]++;
    else
      cnt1[1]++;
  int un = 0;
  for (int i = (0); i < (s2.size()); i++)
    if (s2[i] == '-')
      cnt2[0]++;
    else if (s2[i] == '+')
      cnt2[1]++;
    else
      un++;
  if (cnt2[0] > cnt1[0] || cnt2[1] > cnt1[1]) {
    cout << double(0) << endl;
    return 0;
  }
  double ans = 1;
  ans *= dp[un];
  ans /= dp[cnt1[0] - cnt2[0]];
  ans /= dp[cnt1[1] - cnt2[1]];
  ans /= (1 << un);
  printf("%0.9lf\n", ans);
  return 0;
}
