#include <bits/stdc++.h>
using namespace std;
long long Cnk(long long n, long long k) {
  if (k > n) return 0;
  double result = 1;
  for (long long i = n; i > n - k; i--) {
    result *= i;
    result /= (n - i + 1);
  }
  return result;
}
long long t, d, i, j, k, n, temp, x, ans, y, total;
double p;
string s1, s2;
int main() {
  ios_base::sync_with_stdio(0);
  cin >> s1;
  cin >> s2;
  for (i = 0; i < s1.length(); i++) {
    if (s1[i] == '+')
      x++;
    else
      x--;
  }
  for (i = 0; i < s2.length(); i++) {
    if (s2[i] == '+')
      y++;
    else if (s2[i] == '-')
      y--;
    else
      ans++;
  }
  if (abs(x - y) > ans)
    cout << 0 << endl;
  else if (ans == 0 && x == y)
    cout << 1 << endl;
  else if (ans == 0 && x != y)
    cout << 0 << endl;
  else {
    total = pow(2, ans);
    j = (ans + abs(x - y)) / 2;
    k = Cnk(ans, j);
    p = (k * 1.0) / total;
    cout << setprecision(12) << p << endl;
  }
  return 0;
}
