#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int p, pp, ans, k;
void rec(int idx, int pp) {
  if (idx == k) {
    if (pp == p) ans++;
    return;
  }
  rec(idx + 1, pp + 1);
  rec(idx + 1, pp - 1);
}
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < (int)s1.size(); i++) {
    if (s1[i] == '+')
      p++;
    else
      p--;
    if (s2[i] == '+')
      pp++;
    else if (s2[i] == '-')
      pp--;
    else
      k++;
  }
  rec(0, pp);
  cout << setprecision(12) << fixed << ans / double(1 << k);
}
