#include <bits/stdc++.h>
using namespace std;
int factorial(int n) {
  if (n == 1 || n == 0)
    return 1;
  else
    return n * factorial(n - 1);
}
void solve() {
  string a, b;
  cin >> a >> b;
  int pos1 = 0, neg1 = 0, ques = 0, pos2 = 0, neg2 = 0;
  for (int i = 0; i < a.length(); i++) {
    if (a[i] == '+')
      pos1++;
    else
      neg1++;
    if (b[i] == '+')
      pos2++;
    else if (b[i] == '-')
      neg2++;
    else
      ques++;
  }
  double prob;
  if (pos2 > pos1 || neg2 > neg1) {
    prob = 0;
  } else {
    prob = (long double)factorial(ques) /
           (long double)(factorial(pos1 - pos2) * factorial(neg1 - neg2));
    prob = prob / (1 << ques);
  }
  cout << fixed << setprecision(9) << prob;
}
int main(int argc, char const *argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  solve();
  return 0;
}
