#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int pos1, pos2, neg1, neg2, que;
double C(int k, int n) {
  if (k > n || k < 0) return 0;
  if (k == 0 || k == n) return 1;
  return C(k - 1, n - 1) + C(k, n - 1);
}
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i++) {
    if (s1[i] == '+')
      pos1++;
    else
      neg1++;
  }
  for (int i = 0; i < s2.size(); i++) {
    if (s2[i] == '+')
      pos2++;
    else if (s2[i] == '-')
      neg2++;
    else
      que++;
  }
  double ans1 = 1;
  for (int i = 0; i < que; i++) ans1 *= 2;
  double ans2 = C(pos1 - pos2, que);
  cout << fixed << setprecision(10) << ans2 / ans1 << endl;
}
