#include <bits/stdc++.h>
using namespace std;
int fact(int n) {
  int f = 1;
  for (int i = 1; i <= n; i++) f *= i;
  return f;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string s1, s2;
  cin >> s1 >> s2;
  int n1 = s1.length();
  int p1 = 0, p2 = 0, m1 = 0, m2 = 0, q = 0;
  for (int i = 0; i < n1; i++) {
    if (s1[i] == '+')
      p1++;
    else
      m1++;
    if (s2[i] == '+')
      p2++;
    else if (s2[i] == '-')
      m2++;
    else
      q++;
  }
  p1 = p1 - p2;
  m1 = m1 - m2;
  if (p1 < 0 || m1 < 0) {
    cout << "0.000000000000";
    return 0;
  } else {
    double f = double(fact(q) / (fact(m1) * fact(q - m1))) / double(pow(2, q));
    printf("%0.12f", f);
  }
  return 0;
}
