#include <bits/stdc++.h>
long long mod = 1000000007;
using namespace std;
string s1, s2;
long long pos;
double res;
void david_villa(long long i, long long now, double pro) {
  if (i == s1.size()) {
    if (pos == now) {
      res += pro;
    }
    return;
  }
  if (s2[i] == '+')
    david_villa(i + 1, now + 1, pro);
  else if (s2[i] == '-')
    david_villa(i + 1, now - 1, pro);
  else {
    david_villa(i + 1, now + 1, pro / 2);
    david_villa(i + 1, now - 1, pro / 2);
  }
}
int main() {
  cin >> s1 >> s2;
  long long i;
  for (i = 0; i < s1.size(); i++) {
    if (s1[i] == '+')
      pos++;
    else
      pos--;
  }
  david_villa(0, 0, 1);
  printf("%.9f", res);
  return 0;
}
