#include <bits/stdc++.h>
using namespace std;
int fac(int k) {
  int fact = 1;
  for (int i = 1; i <= k; i++) fact = fact * i;
  return fact;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  map<char, int> g, ans;
  string s1, s2;
  cin >> s1 >> s2;
  cout << setprecision(12) << fixed;
  int n = s1.size();
  for (int i = 0; i < n; i++) {
    g[s1[i]]++;
    ans[s2[i]]++;
  }
  if (ans['?'] + ans['+'] < g['+'] || ans['?'] + ans['-'] < g['-']) {
    cout << double(0);
  } else {
    double k = (1 << ans['?']);
    int a = g['+'] + g['-'] - ans['+'] - ans['-'];
    int h = g['+'] - ans['+'];
    int t = g['-'] - ans['-'];
    double prob = (double)fac(a) / (double)(fac(h) * fac(t));
    cout << prob / k;
  }
  "\n";
}
