#include <bits/stdc++.h>
using namespace std;
long long ct[100005];
int dx[4] = {0, 0, -1, 1};
int dy[4] = {1, -1, 0, 0};
bool cmp(const pair<int, int> &a, const pair<int, int> &b) {
  if (a.first == b.first) return a.second > b.second;
  return a.first < b.first;
}
int cal(int a, int b) {
  int s = a + b;
  int c = 1;
  int d = 1, e = 1;
  for (int i = 1; i <= s; ++i) {
    c = c * i;
    if (i == a) d = c;
    if (i == b) e = c;
  }
  d = c / (d * e);
  return d;
}
int main() {
  string s1, s2;
  cin >> s1 >> s2;
  int s = 0, t = 0, q = 0;
  for (int i = 0; i < s1.size(); ++i) {
    if (s1[i] == '+')
      s++;
    else
      s--;
    if (s2[i] == '+')
      t++;
    else if (s2[i] == '-')
      t--;
    else
      q++;
  }
  if (q == 0 && s != t) {
    cout << 0;
    return 0;
  } else if (s == t && q == 0) {
    cout << 1;
    return 0;
  }
  t = s - t;
  int p = 0, n = 0;
  if (t > 0)
    p = t;
  else
    n = abs(t);
  if (q < p + n) {
    cout << 0;
    return 0;
  }
  if ((q - p - n) % 2 != 0) {
    cout << 0;
    return 0;
  } else {
    int d = q - p - n;
    p += d / 2;
    n += d / 2;
    d = 1;
    int e = pow(2, q);
    d = cal(p, n);
    double ans = d * 1.0;
    ans /= e;
    printf("%.10lf\n", ans);
  }
  return 0;
}
