#include <bits/stdc++.h>
using namespace std;
int check(int begin, int target, int turn) {
  if (begin == target && turn == 0)
    return 1;
  else if (turn == 0)
    return 0;
  if (begin - target > turn || target - begin > turn) return 0;
  int chance = 0;
  chance += check(begin + 1, target, turn - 1);
  chance += check(begin - 1, target, turn - 1);
  return chance;
}
int main() {
  int ans1 = 0, ans2 = 0;
  int unk = 0;
  int cases;
  double chance;
  char arr1[11];
  char arr2[11];
  cin >> arr1;
  cin >> arr2;
  int i, j;
  for (i = 0; i < 10; i++) {
    if (arr1[i] == '+')
      ans1++;
    else if (arr1[i] == '-')
      ans1--;
  }
  for (i = 0; i < 10; i++) {
    if (arr2[i] == '+')
      ans2++;
    else if (arr2[i] == '-')
      ans2--;
    else if (arr2[i] == '?')
      unk++;
  }
  cases = pow(2, unk);
  chance = (double)check(ans2, ans1, unk) / (double)cases;
  printf("%.12lf", chance);
  return 0;
}
