#include <bits/stdc++.h>
using namespace std;
inline bool ascending(int i, int j) { return (i < j); }
inline bool descending(int i, int j) { return (i > j); }
const int MN = 200 + 10;
int comp(const void *a, const void *b) { return (*(int *)a - *(int *)b); }
int manfi, mosbat, mosbat1, manfi1, noe, temp1, temp2;
float res;
long long fact(int num) {
  long long res = 1;
  for (__typeof(1) i = 1; i != num + 1; i++) {
    res *= i;
  }
  return res;
}
int main() {
  string s1, s2;
  cin >> s1;
  cin >> s2;
  for (__typeof(0) i = 0; i != int(s1.size()); i++) {
    if (s1[i] == '-')
      ++manfi;
    else
      ++mosbat;
  }
  for (__typeof(0) i = 0; i != int(s2.size()); i++) {
    if (s2[i] == '-')
      ++manfi1;
    else if (s2[i] == '+')
      ++mosbat1;
    else
      ++noe;
  }
  if (manfi - manfi1 > 0) temp1 = manfi - manfi1;
  if (mosbat - mosbat1 > 0) temp2 = mosbat - mosbat1;
  if (temp1 + temp2 > noe)
    printf("%.10f", res);
  else {
    res = 1;
    for (__typeof(0) i = 0; i != noe; i++) {
      res = res * (0.5);
    }
    long long num1 = fact(temp1);
    long long num2 = fact(temp2);
    long long num3 = fact(temp1 + temp2);
    res = res * num3 / (num2 * num1);
    printf("%.10f", res);
  }
  return 0;
}
