#include <bits/stdc++.h>
using namespace std;
template <class T>
inline T next() {
  T x = 0;
  char a = 0, b = 0;
  while (!isdigit(b = getchar())) a = b;
  x = b - '0';
  while (isdigit(b = getchar())) x = (x << 1) + (x << 3) + b - '0';
  return a == '-' ? -x : x;
}
template <class T>
inline void put(T x) {
  static char txt[32];
  if (x < 0) x = -x, putchar('-');
  if (x == 0) putchar('0');
  int i = 32;
  while (x) txt[--i] = (x % 10) + '0', x /= 10;
  while (i < 32) putchar(txt[i++]);
}
template <class T>
inline void putln(T x) {
  put(x);
  putchar('\n');
}
int nextln(char *p) {
  int len = 0;
  char c;
  while ((c = getchar()) > 0 && c != '\n') *p++ = c, ++len;
  *p = 0;
  return len;
}
struct _ {
  _() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
  }
} _;
char orig_line[16];
char line[16];
int drazil;
int dreamoon;
int calc(int x, int left) {
  if (left == 0) return x == drazil;
  return calc(x + 1, left - 1) + calc(x - 1, left - 1);
}
int main() {
  int length = nextln(orig_line);
  nextln(line);
  int forward = 0;
  int backward = 0;
  int unknown = 0;
  for (int i = 0; i < length; ++i)
    if (orig_line[i] == '+')
      ++drazil;
    else
      --drazil;
  for (int i = 0; i < length; ++i)
    if (line[i] == '+')
      ++forward, ++dreamoon;
    else if (line[i] == '-')
      ++backward, --dreamoon;
    else
      ++unknown;
  int win = calc(dreamoon, unknown);
  printf("%.15f\n", win * 1.0 / (1 << unknown));
}
