#include <bits/stdc++.h>
using namespace std;
long long fact(long long a) {
  if (a == 0) return 1;
  if (a == 1) return 1;
  return a * fact(a - 1);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  string s1, s2;
  cin >> s1 >> s2;
  long long p = 0, m = 0;
  for (long long i = 0; i < s1.length(); i++)
    if (s1[i] == '+')
      p++;
    else
      m++;
  long long p1 = 0, m1 = 0, q = 0;
  for (long long i = 0; i < s2.length(); i++)
    if (s2[i] == '+')
      p1++;
    else if (s2[i] == '-')
      m1++;
    else
      q++;
  cout << fixed << setprecision(12);
  if (q == 0 && p == p1 && m == m1)
    cout << 1.0;
  else if (p1 > p || m1 > m || (p - p1) > q || (m - m1) > q)
    cout << 0.0;
  else
    cout << (fact(q) / fact(q + p1 - p) / fact(p - p1)) * 1.0 / (1 << q);
  return 0;
}
