#include <bits/stdc++.h>
using namespace std;
int dx[] = {1, -1, 1, -1, 0, 1, -1, 0};
int dy[] = {1, -1, -1, 1, 1, 0, 0, -1};
int n, m;
const long long inf = 1e17;
bool isvalid(int x, int y) {
  if (x >= 0 && x < n && y >= 0 && y < m) {
    return true;
  }
  return false;
}
int s = 0, tobe = 0, ans = 0;
void rec(int count, int sum) {
  if (count == 0) {
    if ((sum + tobe) == s) {
      ans++;
    }
    return;
  }
  rec(count - 1, sum + 1);
  rec(count - 1, sum - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cout << fixed << showpoint << setprecision(10);
  string a, b;
  cin >> a >> b;
  int count = 0;
  for (int i = 0; i < a.size(); i++) {
    if (a[i] == '+') s++;
    if (a[i] == '-') s--;
    if (b[i] == '+') tobe++;
    if (b[i] == '-') tobe--;
    if (b[i] == '?') count++;
  }
  if (count == 0) {
    if (s == tobe) {
      cout << 1.00000000000;
    } else {
      cout << 0.00000000000;
    }
    return 0;
  }
  rec(count, 0);
  double got = 1.0 * ans / (pow(2, count));
  cout << got;
}
