#include <bits/stdc++.h>
using namespace std;
string a, b;
int pos = 0, cur = 0, q = 0;
int cal(int i, int tot) {
  if (i == q) return (tot == pos);
  int x = cal(i + 1, tot + 1);
  int y = cal(i + 1, tot - 1);
  return (x + y);
}
int main() {
  cin >> a >> b;
  for (int i = 0; i < (int)(a.size()); ++i)
    if (a[i] == '+')
      pos++;
    else
      pos--;
  for (int i = 0; i < (int)(b.size()); ++i)
    if (b[i] == '?')
      q++;
    else if (b[i] == '+')
      cur++;
    else
      cur--;
  int res = cal(0, cur);
  printf("%.12lf\n", res / pow(2.0, q));
  return 0;
}
