#include <bits/stdc++.h>
using namespace std;
int power(int n, int m) {
  int result = 1, i;
  for (i = 0; i < m; i++) result = result * n;
  return result;
}
int fact(int n) {
  int result = 1, i;
  for (i = 1; i <= n; i++) result = result * i;
  return result;
}
int main() {
  int plus = 0, minus = 0, qm = 0, l, i;
  double prob;
  char s1[15], s2[15];
  scanf("%s%s", s1, s2);
  l = strlen(s1);
  for (i = 0; i < l; i++) {
    if (s1[i] == '+')
      plus++;
    else if (s1[i] == '-')
      minus++;
  }
  l = strlen(s2);
  for (i = 0; i < l; i++) {
    if (s2[i] == '+')
      plus--;
    else if (s2[i] == '-')
      minus--;
    else
      qm++;
  }
  if (plus < 0 || minus < 0)
    prob = 0.000;
  else {
    if (qm == 0)
      prob = 1.0000;
    else {
      prob = (double)(fact(plus + minus) / (fact(plus) * fact(minus))) /
             power(2, qm);
    }
  }
  printf("%0.9lf", prob);
  return 0;
}
