#include <bits/stdc++.h>
using namespace std;
vector<vector<vector<long double>>> dp(
    11, vector<vector<long double>>(11, vector<long double>(11, -1)));
long double go(long long p, long long m, long long q) {
  if (m < 0 || p < 0 || q < 0) return 0;
  if (dp[q][p][m] != -1) return dp[q][p][m];
  return dp[q][p][m] = (go(p - 1, m, q - 1) + go(p, m - 1, q - 1)) / 2;
}
int main() {
  string in, out;
  getline(cin, in);
  getline(cin, out);
  long long p = 0, q = 0, m = 0;
  for (auto i = in.begin(); i != in.end(); ++i) {
    if ((*i) == '+')
      ++p;
    else
      ++m;
  }
  for (auto i = out.begin(); i != out.end(); ++i) {
    if ((*i) == '+')
      --p;
    else if ((*i) == '-')
      --m;
    else
      ++q;
  }
  dp[0][0][0] = 1;
  cout << fixed << setprecision(10) << go(p, m, q);
  return 0;
}
