#include <bits/stdc++.h>
using namespace std;
int fact(int n) {
  if (n == 1 || n == 0) return 1;
  return n * fact(n - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  string s1, s2;
  cin >> s1 >> s2;
  int ans1 = 0, ans2 = 0, temp, ques = 0;
  for (int i = 0; i < s1.length(); i++) ans1 += (s1[i] == '+' ? 1 : -1);
  for (int i = 0; i < s2.length(); i++)
    if (s2[i] == '?')
      ques++;
    else
      ans2 += (s2[i] == '+' ? 1 : -1);
  temp = ans1 - ans2;
  float answer;
  int no_of_plus = 0;
  if ((temp + ques) % 2 != 0 || ques < abs(temp))
    answer = 0;
  else {
    for (int i = 0; i < ques; i++)
      if ((ques - i) - i == temp) {
        no_of_plus = ques - i;
        break;
      }
    answer = ((float)fact(ques) /
              ((float)fact(no_of_plus) * (float)fact(ques - no_of_plus))) /
             (float)pow(2, ques);
  }
  printf("%.12f\n", answer);
  return 0;
}
