Dreamoon is standing at the position 0 on a number line. Drazil is sending a list of commands through Wi-Fi to Dreamoon's smartphone and Dreamoon follows them.Each command is one of the following two types:   Go 1 unit towards the positive direction, denoted as '+'  Go 1 unit towards the negative direction, denoted as '-' But the Wi-Fi condition is so poor that Dreamoon's smartphone reports some of the commands can't be recognized and Dreamoon knows that some of them might even be wrong though successfully recognized. Dreamoon decides to follow every recognized command and toss a fair coin to decide those unrecognized ones (that means, he moves to the 1 unit to the negative or positive direction with the same probability 0.5). You are given an original list of commands sent by Drazil and list received by Dreamoon. What is the probability that Dreamoon ends in the position originally supposed to be final by Drazil's commands?

The first line contains a string s1 — the commands Drazil sends to Dreamoon, this string consists of only the characters in the set {'+', '-'}.  The second line contains a string s2 — the commands Dreamoon's smartphone recognizes, this string consists of only the characters in the set {'+', '-', '?'}. '?' denotes an unrecognized command. Lengths of two strings are equal and do not exceed 10.

Output a single real number corresponding to the probability. The answer will be considered correct if its relative or absolute error doesn't exceed 10 - 9.

NoteFor the first sample, both s1 and s2 will lead Dreamoon to finish at the same position  + 1. For the second sample, s1 will lead Dreamoon to finish at position 0, while there are four possibilites for s2: {"+-++", "+-+-", "+--+", "+---"} with ending position {+2, 0, 0, -2} respectively. So there are 2 correct cases out of 4, so the probability of finishing at the correct position is 0.5. For the third sample, s2 could only lead us to finish at positions {+1, -1, -3}, so the probability to finish at the correct position  + 3 is 0.

using System;
using System.Linq;

namespace DreamoonAndWifi
{
    partial class DreamoonAndWifi
    {
        static int[] position = new int[21];

        static void Main(string[] args)
        {
            string s1, s2, answer;
            int final = 10;

            s1 = ReadLine();
            s2 = ReadLine();

            foreach (char command in s1)
            {
                if (command == '+')
                    final++;
                else
                    final--;
            }

            Solve(10, 0, s2);
            answer = string.Format("{0:0.000000000000}", (double)position[final] / (double)position.Sum()).Replace(",", ".");
            Console.WriteLine(answer);
        }

        private static void Solve(int currentPosition, int index, string commands)
        {
            if (index == commands.Length)
            {
                position[currentPosition]++;
            }
            else
            {
                switch (commands[index])
                {
                    case '+':
                        Solve(++currentPosition, index + 1, commands);
                        break;

                    case '-':
                        Solve(--currentPosition, index + 1, commands);
                        break;

                    case '?':
                        Solve(currentPosition + 1, index + 1, commands);
                        Solve(currentPosition - 1, index + 1, commands);
                        break;
                }
            }
        }
    }

    partial class DreamoonAndWifi
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class p2
	{
		static void Main(string[] args)
		{
			//p1 o = new p1();
			//o.foo();

			p2 o = new p2();
			o.foo();

			//p3 o = new p3();
			//o.foo();

			Console.ReadLine();
		}
		public void foo()
		{
			string s1 = Console.ReadLine();
			string s2 = Console.ReadLine();

			fp = finalPoint(s1);
			bar(s2);
			double d = suc / n;
			Console.WriteLine("{0}", d.ToString("F12", System.Globalization.CultureInfo.InvariantCulture));
		}
		private int fp;
		private double n = 0;
		private double suc = 0;
		private void bar(string s)
		{
			if (s.IndexOf('?') < 0)
			{
				n++;
				if (finalPoint(s) == fp)
					suc++;
				return;
			}

			int ind = s.IndexOf('?');
			string a = s.Substring(0, ind);
			string b = s.Substring(ind + 1);

			bar(a + "+" + b);
			bar(a + "-" + b);
		}
		private int finalPoint(string s)
		{
			int c = 0;
			for (int i = 0; i < s.Length; i++)
			{
				if (s[i] == '+')
					c++;
				else
					c--;
			}
			return c;
		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using Solver.Ex;
using Watch = System.Diagnostics.Stopwatch;
using StringBuilder = System.Text.StringBuilder;
using BitVector = System.Collections.Specialized.BitVector32;
namespace Solver
{
    public class Solver
    {
        public void Solve()
        {
            var s = sc.Scan();
            var t = sc.Scan();
            var spos = 0;
            foreach (var x in s)
                if (x == '+') spos++;
                else spos--;
            var dp = new double[100, 2];
            dp[50, 0] = 1.0;
            for (int i = 0; i < t.Length; i++)
            {
                var from = i & 1;
                var to = from ^ 1;
                for (int j = 25; j < 75; j++)
                {
                    if (dp[j, from] < 1e-9)
                    {
                        continue;
                    }
                    var p = dp[j, from];
                    dp[j, from] = 0;
                    if (t[i] == '+')
                        dp[j + 1, to] += p;
                    else if (t[i] == '-')
                        dp[j - 1, to] += p;
                    else
                    {
                        dp[j + 1, to] += 0.5 * p;
                        dp[j - 1, to] += 0.5 * p;
                    }
                }
            }
            IO.Printer.Out.PrintLine(dp[50 + spos, (t.Length & 1)]);

        }

        internal IO.StreamScanner sc;

    }

    #region Main and Settings
    static class Program
    {
        static void Main(string[] arg)
        {
#if DEBUG
            var errStream = new System.IO.FileStream(@"..\..\dbg.out", System.IO.FileMode.Create, System.IO.FileAccess.Write, System.IO.FileShare.ReadWrite);
            System.Diagnostics.Debug.Listeners.Add(new System.Diagnostics.TextWriterTraceListener(errStream, "debugStream"));
            System.Diagnostics.Debug.AutoFlush = false;
            var sw = new Watch();
            sw.Start();
            try
            {
#endif
                var solver = new Solver();
                solver.sc = new IO.StreamScanner(Console.OpenStandardInput());
                IO.Printer.Out = new IO.Printer(new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false });
                solver.Solve();
                IO.Printer.Out.Flush();
#if DEBUG
            }
            catch (Exception ex)
            {
                Console.Error.WriteLine(ex.Message);
                Console.Error.WriteLine(ex.StackTrace);
            }
            finally
            {
                sw.Stop();
                Console.ForegroundColor = ConsoleColor.Green;
                Console.Error.WriteLine("Time:{0}ms", sw.ElapsedMilliseconds);
                System.Diagnostics.Debug.Close();
                System.Threading.Thread.Sleep(System.Threading.Timeout.Infinite);
            }
#endif
        }

    }
    #endregion
}
#region IO Helper
namespace Solver.IO
{
    public class Printer
    {
        static Printer()
        {
            Out = new Printer(Console.Out);
        }
        public static Printer Out { get; set; }
        private readonly System.IO.TextWriter writer;
        private readonly System.Globalization.CultureInfo info;
        public string Separator { get; set; }
        public string NewLine { get { return writer.NewLine; } set { writer.NewLine = value ?? "\n"; } }
        public Printer(System.IO.TextWriter tw = null, System.Globalization.CultureInfo ci = null, string separator = null, string newLine = null)
        {
            writer = tw ?? System.IO.TextWriter.Null;
            info = ci ?? System.Globalization.CultureInfo.InvariantCulture;
            NewLine = newLine;
            Separator = separator ?? " ";
        }
        public void Print(int num) { writer.Write(num.ToString(info)); }
        public void Print(int num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(long num) { writer.Write(num.ToString(info)); }
        public void Print(long num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(double num) { writer.Write(num.ToString("F12", info)); }
        public void Print(double num, string format) { writer.Write(num.ToString(format, info)); }
        public void Print(string str) { writer.Write(str); }
        public void Print(string format, params object[] arg) { writer.Write(string.Format(info, format, arg)); }
        public void Print<T>(string format, IEnumerable<T> sources) { writer.Write(format, sources.OfType<object>().ToArray()); }
        public void Print(IEnumerable<char> sources) { writer.Write(sources.AsString()); }
        public void Print<T>(IEnumerable<T> sources)
        {
            var res = new System.Text.StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.Write(res.ToString(0, res.Length - Separator.Length));
        }
        public void PrintLine() { writer.WriteLine(); }
        public void PrintLine(int num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(int num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(long num) { writer.WriteLine(num.ToString(info)); }
        public void PrintLine(long num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(double num) { writer.WriteLine(num.ToString("F12", info)); }
        public void PrintLine(double num, string format) { writer.WriteLine(num.ToString(format, info)); }
        public void PrintLine(string str) { writer.WriteLine(str); }
        public void PrintLine(string format, params object[] arg) { writer.WriteLine(string.Format(info, format, arg)); }
        public void PrintLine<T>(string format, IEnumerable<T> sources) { writer.WriteLine(format, sources.OfType<object>().ToArray()); }
        public void PrintLine<T>(IEnumerable<T> sources)
        {
            var res = new StringBuilder();
            foreach (var x in sources)
            {
                res.AppendFormat(info, "{0}", x);
                if (!string.IsNullOrEmpty(Separator))
                    res.Append(Separator);
            }
            writer.WriteLine(res.ToString(0, res.Length - Separator.Length));
        }
        public void Flush() { writer.Flush(); }
    }
    public class StreamScanner
    {
        public StreamScanner(System.IO.Stream stream)
        {
            iStream = stream;
        }
        private readonly System.IO.Stream iStream;
        private readonly byte[] buf = new byte[1024];
        private int len, ptr;
        private bool eof = false;
        public bool EndOfStream { get { return eof; } }
        private byte readByte()
        {
            if (eof) throw new System.IO.EndOfStreamException();
            if (ptr >= len)
            {
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return 0;
                }
            }
            return buf[ptr++];
        }
        private bool inSpan(byte c)
        {
            const byte lb = 33, ub = 126;
            return !(c >= lb && c <= ub);
        }
        private byte skip()
        {
            byte b = 0;
            do b = readByte();
            while (!eof && inSpan(b));
            return b;
        }
        public char Char()
        {
            return (char)skip();
        }
        public char[] Char(int n)
        {
            var a = new char[n];
            for (int i = 0; i < n; i++)
                a[i] = (char)skip();
            return a;
        }
        public char[][] Char(int n, int m)
        {
            var a = new char[n][];
            for (int i = 0; i < n; i++)
                a[i] = Char(m);
            return a;
        }
        public string Scan()
        {

            const byte lb = 33, ub = 126;
            if (eof) throw new System.IO.EndOfStreamException();

            do
            {
                while (ptr < len && (buf[ptr] < lb || ub < buf[ptr]))
                {
                    ptr++;
                }
                if (ptr < len)
                    break;
                ptr = 0;
                len = iStream.Read(buf, 0, 1024);
                if (len <= 0)
                {
                    eof = true;
                    return null;
                }
                continue;
            } while (true);

            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] < lb || ub < buf[i])
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        ptr = i + 1;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public string[] Scan(int n)
        {
            var a = new string[n];
            for (int i = 0; i < n; i++)
                a[i] = Scan();
            return a;
        }
        public string ScanLine()
        {
            const byte el = 10;
            if (eof) throw new System.IO.EndOfStreamException();
            StringBuilder sb = null;
            do
            {
                var i = ptr;
                while (i < len)
                {
                    if (buf[i] == el)
                    {
                        string s;
                        if (sb != null)
                        {
                            sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                            s = sb.ToString();
                        }
                        else s = new string(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i - ptr));
                        ptr = i + 1;
                        return s;
                    }
                    i++;
                }
                i = len - ptr;
                if (sb == null) sb = new StringBuilder(i + 32);
                sb.Append(System.Text.UTF8Encoding.Default.GetChars(buf, ptr, i));
                ptr = 0;
            } while ((len = iStream.Read(buf, 0, 1024)) > 0);
            eof = true;
            return sb.ToString();
        }
        public double Double()
        {
            return double.Parse(Scan(), System.Globalization.CultureInfo.InvariantCulture);
        }
        public double[] Double(int n)
        {
            var a = new double[n];
            for (int i = 0; i < n; i++)
                a[i] = Double();
            return a;
        }
        public int Integer()
        {
            var ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));

            if (b == mynus)
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                {
                    ret = ret * 10 + b - zero;
                }
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public int[] Integer(int n)
        {
            var a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = Integer();
            return a;
        }
        public long Long()
        {
            long ret = 0;
            byte b = 0;
            bool isMynus = false;
            const byte zero = 48, nine = 57, mynus = 45;
            do b = readByte();
            while (!eof && !((b >= zero && b <= nine) || b == mynus));
            if (b == '-')
            {
                isMynus = true;
                b = readByte();
            }
            while (true)
            {
                if (b >= zero && b <= nine)
                    ret = ret * 10 + (b - zero);
                else return isMynus ? -ret : ret;
                b = readByte();
            }

        }
        public long[] Long(int n)
        {
            var a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = Long();
            return a;
        }
        public void Flush()
        {
            iStream.Flush();
        }

    }

}
#endregion
#region Extension
namespace Solver.Ex
{
    static public partial class EnumerableEx
    {
        static public string AsString(this IEnumerable<char> source)
        {
            return new string(source.ToArray());
        }
        static public string AsJoinedString<T>(this IEnumerable<T> source, string separator = " ")
        {
            return string.Join(separator, source);
        }
        static public T[] Enumerate<T>(this int n, Func<int, T> selector)
        {
            var res = new T[n];
            for (int i = 0; i < n; i++)
                res[i] = selector(i);
            return res;
        }
    }
}
#endregion

using System;
using System.IO;

class Algo
{
    int[] f = new int[22];
    public void Run()
    {
        f[0] = 1;
        for (int i = 1; i < 22; i++) f[i] = f[i - 1] * i;
        string s1 = cin.ReadLine();
        string s2 = cin.ReadLine();
        int plus1 = 0, plus2 = 0, q = 0;
        for (int i = 0; i < s1.Length; i++) plus1 += (s1[i] == '+' ? 1 : 0);
        for (int i = 0; i < s2.Length; i++)
        {
            plus2 += (s2[i] == '+' ? 1 : 0);
            q += (s2[i] == '?' ? 1 : 0);
        }
        if (plus1 > plus2 + q || plus1 < plus2)
        {
            cout.WriteLine("0.0");
            return;
        }
        int n = C(q, plus1 - plus2);
        int m = 1 << q;
        double ans = 1.0 * n / m;
        string res = ans.ToString();
        for (int i = 0; i < res.Length; i++)
        {
            if (res[i] == ',') cout.Write(".");
            else cout.Write(res[i]);
        }
        cout.WriteLine();
    }

    int C(int n, int m)
    {
        int ans = f[n] / f[m] / f[n - m];
        return ans;
    }

    public StreamReader cin = null;
    public StreamWriter cout = null;
}

class Program
{
    static void Main()
    {
        Algo task = new Algo();
#if DEBUG
        task.cin = new StreamReader("input.txt");
        task.cout = new StreamWriter("output.txt");
#else
        task.cin = new StreamReader(Console.OpenStandardInput());
        task.cout = new StreamWriter(Console.OpenStandardOutput());
#endif
        task.cout.AutoFlush = true;
        task.Run();
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;

namespace Practise
{
    class Program
    {
        public static void Main()
        {
            int init = 0;
            String original = Console.ReadLine();

            for (int i = 0; i < original.Length; i++)
            {
                if (original[i] == '+')
                    init++;
                else
                    init--;
            }

            String mangled = Console.ReadLine();
            Dictionary<int, double> dict = new Dictionary<int, double>();
            dict.Add(0, 1.0);

            for (int i = 0; i < mangled.Length; i++)
            {
                Dictionary<int, double> temp = new Dictionary<int, double>();

                if (mangled[i] == '+')
                {
                    foreach(KeyValuePair<int, double> kvp in dict)
                    {
                        int newLoc = kvp.Key + 1;
                        if (temp.ContainsKey(newLoc))
                        {
                            temp[newLoc] += kvp.Value;
                        }
                        else
                        {
                            temp.Add(newLoc, kvp.Value);
                        }

                    }
                }
                else if (mangled[i] == '-')
                {
                    foreach (KeyValuePair<int, double> kvp in dict)
                    {
                        int newLoc = kvp.Key - 1;
                        if (temp.ContainsKey(newLoc))
                        {
                            temp[newLoc] += kvp.Value;
                        }
                        else
                        {
                            temp.Add(newLoc, kvp.Value);
                        }

                    }
                }
                else
                {
                    foreach (KeyValuePair<int, double> kvp in dict)
                    {
                        int newLoc1 = kvp.Key - 1;
                        int newLoc2 = kvp.Key + 1;
                        double val = kvp.Value / 2.0;
                        if (temp.ContainsKey(newLoc1))
                        {
                            temp[newLoc1] += val;
                        }
                        else
                        {
                            temp.Add(newLoc1, val);
                        }

                        if (temp.ContainsKey(newLoc2))
                        {
                            temp[newLoc2] += val;
                        }
                        else
                        {
                            temp.Add(newLoc2, val);
                        }
                    }
                }

                dict.Clear();
                foreach (KeyValuePair<int, double> kvp in temp)
                {
                    dict.Add(kvp.Key, kvp.Value);
                }
            }

            if (dict.ContainsKey(init))
            {
                Console.WriteLine(dict[init].ToString(CultureInfo.InvariantCulture));
            }
            else
            {
                Console.WriteLine("0.000000000000");
            }
        }
    }

    class MyReader
    {
        public static int ReadInt()
        {
            return Convert.ToInt32(Console.ReadLine());
        }

        public static long ReadLong()
        {
            return Convert.ToInt32(Console.ReadLine());
        }

        public static void SplitTwoInt(out int a, out int b)
        {
            int[] ret = ReadAndSplitInt();
            a = ret[0];
            b = ret[1];
        }

        public static void SplitThreeInt(out int a, out int b, out int c)
        {
            int[] ret = ReadAndSplitInt();
            a = ret[0];
            b = ret[1];
            c = ret[2];
        }

        public static void SplitThreeDouble(out double a, out double b, out double c)
        {
            double[] ret = ReadAndSplitDouble();
            a = ret[0];
            b = ret[1];
            c = ret[2];
        }

        public static int[] ReadAndSplitInt()
        {
            String[] input = Console.ReadLine().Split();
            int count = input.Length;
            int[] a = new int[count];
            for (int i = 0; i < count; i++)
            {
                a[i] = Convert.ToInt32(input[i]);
            }
            return a;
        }

        public static double[] ReadAndSplitDouble()
        {
            String[] input = Console.ReadLine().Split();
            int count = input.Length;
            double[] a = new double[count];
            for (int i = 0; i < count; i++)
            {
                a[i] = Convert.ToDouble(input[i]);
            }
            return a;
        }
    }

    class MyUtility
    {
        public static List<int> GetPrimes(int limit)
        {
            bool[] isPrime = GeneratePrimes(limit);
            List<int> primes = new List<int>();

            for (int i = 2; i <= limit; i++)
            {
                if (isPrime[i])
                    primes.Add(i);
            }

            return primes;
        }

        public static bool[] GeneratePrimes(int limit)
        {
            bool[] isPrime = new bool[limit + 1];
            for (int i = 2; i <= limit; i++)
                isPrime[i] = true;

            for (int i = 2; i <= limit; i++)
            {
                if (isPrime[i])
                {
                    int j = 2;
                    while (i * j <= limit)
                    {
                        isPrime[i * j] = false;
                        j++;
                    }
                }
            }

            return isPrime;
        }
    }
}

using System;
using System.Globalization;
using System.Linq;

class B476 {
    static int Choose(int n, int k) {
        if (k < 0 || n < k) return 0;
        int ans = 1;
        for (int i = 0; i < k; ++i) ans = ans * (n - i) / (i + 1);
        return ans;
    }

    static double Solve(int s, int d) {
        var sd = s + d;
        if ((sd & 1) != 0) return 0.0;
        var a = sd >> 1;
        return (double)Choose(s, a) / (1 << s);
    }

    public static void Main() {
        var s1 = Console.ReadLine();
        var s2 = Console.ReadLine();
        var a1 = s1.Count(k => k == '+') - s1.Count(k => k == '-');
        var a2 = s2.Count(k => k == '+') - s2.Count(k => k == '-');
        var ans = Solve(s2.Count(k => k == '?'), a1 - a2);
        Console.WriteLine(ans.ToString(CultureInfo.InvariantCulture));
    }
}

using System;

namespace R_B_272
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int t = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') t++;
                else t--;
            }
            int[][] a = new int[25][];
            a[0] = new int[1];
            a[0][0] = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s2[i] == '?')
                {
                    a[i + 1] = new int[a[i].Length * 2];
                    int j = 0, z = 0;
                    while (j < a[i].Length)
                    {
                        a[i + 1][z] = a[i][j] - 1;
                        z++;
                        a[i + 1][z] = a[i][j] + 1;
                        z++;
                        j++;
                    }
                }
                else
                {
                    a[i + 1] = new int[a[i].Length];
                    if (s2[i] == '+')
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] + 1;
                        }
                    }
                    else
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] - 1;
                        }
                    }
                }
            }

            double count = 0;
            for (int i = 0; i < a[s2.Length].Length; i++)
            {
                if (a[s2.Length][i] == t) count++;
            }
            double d = (count / a[s2.Length].Length) % 1000000000;
            Console.WriteLine(d.ToString(System.Globalization.CultureInfo.GetCultureInfo("en-US")));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dreamoon_and_WiFi
{
    class Program
    {

        static int suc_Event = 0;
        static int end_Pos = 0;
        static void Main(string[] args)
        {
            string str_Correct = Console.ReadLine();
            string str_Unverified = Console.ReadLine();
            int pos = 0;
            int num_unKnown = 0;

            foreach (char map in str_Correct)
            {
                switch (map)
                {
                    case '+':
                        end_Pos++;
                        break;
                    case '-':
                        end_Pos--;
                        break;
                }
            }

            foreach (char map in str_Unverified)
            {
                switch (map)
                {
                    case '+':
                        pos++;
                        break;
                    case '-':
                        pos--;
                        break;
                    case '?':
                        num_unKnown++;
                        break;
                }
            }

            Move(pos, num_unKnown);

            string str_probability = string.Format("{0:0.000000000000}", (double)suc_Event / (double)Math.Pow(2,num_unKnown)).Replace(',','.');
            Console.Write(str_probability);
            Console.Read();

        }

        private static void Move(int CurrentPos,int num_unKnown)
        {
            if (num_unKnown >= 1)
            {
                Move(CurrentPos+1, num_unKnown-1);
                Move(CurrentPos-1, num_unKnown-1);
            }
            else if (CurrentPos == end_Pos)
            {
                suc_Event++;
            }
        }
    }

}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;

public static class solver
{
    class Pos
    {
        public int X = 0;
        public double Prob = 1;
    }

    static void AddCmd(List<Pos> variants, char cmd)
    {
        if (cmd == '+') {
            foreach (var pos in variants) {
                pos.X += 1;
            }
        }
        else if (cmd == '-') {
            foreach (var pos in variants) {
                pos.X -= 1;
            }
        }
        else {
            var additional = variants.Select(p => new Pos { X = p.X + 1, Prob = p.Prob / 2 }).ToArray();
            foreach (var pos in variants) {
                pos.X -= 1;
                pos.Prob /= 2;
            }
            variants.AddRange(additional);
        }
    }

    public static void Main()
    {
        var sent = Console.ReadLine();
        var recv = Console.ReadLine();

        var variants = new List<Pos>();
        variants.Add(new Pos());
        foreach (var c in recv.ToCharArray()) {
            AddCmd(variants, c);
        }

        var correct = sent.ToCharArray().Sum(c => c == '+' ? 1 : -1);

        Console.WriteLine(variants.Sum(p => p.X == correct ? p.Prob : 0).ToString("R", CultureInfo.InvariantCulture));

#if !ONLINE_JUDGE
        Console.ReadLine();
#endif
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pr1
{
    class Program
    {
        static int gcd(int a,int b)
        {
            while(a!=0&&b!=0)
            {
                if(a>b)
                    a%=b;
                else
                    b%=a;
            }
            if(a==0)
                return b;
            else
                return a;
        }
        static int Factorial(int x)
        {
            return (x == 0) ? 1 : x * Factorial(x - 1);
        }
        static void Main()
        {

            string q=  Console.ReadLine();
            string w=  Console.ReadLine();
            int n=0,m=0,v=0;
            for(int i=0;i<q.Length;i++)
                if(q[i]=='+')
                    n++;
                else
                    n--;
            for(int i=0;i<w.Length;i++)
                if(w[i]=='+')
                    m++;
                else if(w[i]=='-')
                    m--;
                else
                    v++;
            if(Math.Abs(n)%2!=(Math.Abs(m)+v)%2||Math.Abs(n-m)>v)
                Console.Write(0);
            else
                Console.Write(((double)(Factorial(v)/Factorial(v-(v-Math.Abs(n-m))/2)/Factorial((v-Math.Abs(n-m))/2))/Math.Pow(2,v)).ToString().Replace(',','.'));

        }
    }
}

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.Globalization;

namespace _272_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int d1 = 0;
            int d2 = 0;
            var d2list = new List<int>();

            foreach(char sym in s1)
            {
                if (sym == '+')
                    d1 += 1;
                else d1 -= 1;
            }

            int k = 0;
            foreach (char sym in s2)
            {
                if (sym == '+')
                    d2 += 1;
                else
                    if (sym == '-')
                        d2 -= 1;
                    else k++;
            }

            if(k != 0)
            {
                d2list.Add(d2);
                for (int i = k; i > 0; i--)
                {
                    int count = d2list.Count;
                    for (int j = 0; j < count; j++ )//????
                        {
                            d2list.Add(d2list[j] + 1);
                            d2list.Add(d2list[j] - 1);
                        }
                    d2list.RemoveRange(0, count);
                    /*d2list.Add(d2 + i);
                    d2list.Add(d2 - i);*/
                }
                var t = d2list.FindAll(x => x == d1);

                if (t.Count != 0)
                {
                    double res = (double)t.Count / (double)d2list.Count;
                    Console.Write(res.ToString((CultureInfo.InvariantCulture)));
                }
                else Console.Write(0.0);
            }
            else
            {
                if (d1 != d2)
                    Console.Write(0.0);
                else Console.Write(1.0);
            }
        }
    }
}

using System;
using System.Globalization;
using System.IO;
using System.Text;

namespace Dreamoon_and_WiFi
{
    internal class Program
    {
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024*10), Encoding.ASCII, false, 1024*10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024*10), Encoding.ASCII, 1024*10);

        private static void Main(string[] args)
        {
            string s1 = reader.ReadLine();
            string s2 = reader.ReadLine();

            int shift = 0;
            foreach (char c in s1)
            {
                if (c == '+')
                    shift++;
                else
                {
                    shift--;
                }
            }

            int cc = 0;

            foreach (char c in s2)
            {
                if (c == '+')
                    shift--;
                else if (c == '-')
                {
                    shift++;
                }
                else
                {
                    cc++;
                }
            }

            if (shift < 0)
                shift = -shift;

            if (shift > cc || (cc==0 && shift!=0))
            {
                writer.WriteLine("0.0");
            }
            else if (cc==0 && shift==0)
            {
                writer.WriteLine("1.0");
            }
            else
            {
                int max = 1 << cc;
                int countok = 0;
                for (int i = 0; i < max; i++)
                {
                    if (cc-2*Bitcount(i)==shift)
                    {
                        countok ++;
                    }
                }
                writer.WriteLine("{0}", (1.0*countok / max).ToString("#0.0000000000", CultureInfo.InvariantCulture));
            }

            writer.Flush();
        }

        static int Bitcount(int n)
        {
            int count = 0;
            while (n != 0)
            {
                count++;
                n &= (n - 1);
            }
            return count;
        }

    }
}

#region Using Statements
using GenericArithmetic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

#endregion
namespace csConsoleforStudy
{
 using System.Collections.Generic;
 using System.Globalization;

 class Program
 {
  static readonly Encoding TargetEcoding = Encoding.Unicode;
  static void Main(string[] args)
  {
   OpenStream();
   Solver s = new Solver();
   s.Solve();
   CloseStream();
  }

  static void OpenStream()
  {
  }

  static void CloseStream()
  {
  }

  static void CheckMemory()
  {
  }
 }

 class Solver
 {
  public static readonly Encoding TargetEncoding = Encoding.Unicode;
  const int SIZE = 5005;
  private const double AbsoluteError = 1e-10;
  private const double RelativeError = 1e-8;
  static int mod = 1000000007;
  public void Solve()
  {
   int k = -6 % 2;
   string s1 = rs();
   string s2 = rs();
   int target = 0;
   int pos = 0;
   int que = 0;
   double result = 0f;
   for (int i = 0; i < s1.Length; i++)
   {
    if (s1[i] == '+')
     target++;
    else
     target--;
   }

   for (int i = 0; i < s2.Length; i++)
   {
    if (s2[i] == '+')
     pos++;
    else if (s2[i] == '-')
     pos--;
    else
    {
     que++;
    }
   }

   if (que % 2 == 0)
   {
    if ((target - pos) % 2 == 0)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus, minus;
     if (target - pos > 0)
     {
      plus = d;
      minus = 0;
     }
     else
     {
      plus = 0;
      minus = d;
     }

     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }
   else
   {
    if (IsOdd(target - pos))
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus, minus;
     if (target - pos > 0)
     {
      plus = d;
      minus = 0;
     }
     else
     {
      plus = 0;
      minus = d;
     }

     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }

   string ans = result.ToString("F10", CultureInfo.InvariantCulture);
   Console.Write(ans);
  }

#region SolverUtils
  private static List<int> factorial = new List<int>(new int[]{1});
  private static int NextInt()
  {
   int c;
   int res = 0;
   do
   {
    c = Console.Read();
    if (c == -1)
     return res;
   }
   while (c < '0' || c > '9');
   res = c - '0';
   while (true)
   {
    c = Console.Read();
    if (c < '0' || c > '9')
     return res;
    res *= 10;
    res += c - '0';
   }
  }

  static string rs()
  {
   return Console.ReadLine();
  }

  static int ri()
  {
   return int.Parse(Console.ReadLine());
  }

  static uint rui()
  {
   return uint.Parse(Console.ReadLine());
  }

  static long rl()
  {
   return long.Parse(Console.ReadLine());
  }

  static ulong rul()
  {
   return ulong.Parse(Console.ReadLine());
  }

  static double rd()
  {
   return double.Parse(Console.ReadLine());
  }

  static string[] rsa()
  {
   return Console.ReadLine().Split(' ');
  }

  static int[] ria()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));
  }

  static uint[] ruia()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));
  }

  static long[] rla()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));
  }

  static ulong[] rula()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));
  }

  static double[] rda()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));
  }

  static void ReadLineAndAssign(string type, params object[] p)
  {
   dynamic input;
   if (type.StartsWith("i"))
    input = ria();
   else if (type.StartsWith("l"))
    input = rla();
   else if (type.StartsWith("d"))
    input = rda();
   else
    throw new ArgumentException("no match " + type.ToString());
   for (int i = 0; i < p.Length; i++)
   {
    p[i] = input[i];
   }
  }

  static void SwapIfGreater<T>(ref T lhs, ref T rhs)where T : IComparable<T>
  {
   T temp;
   if (lhs.CompareTo(rhs) > 0)
   {
    temp = lhs;
    lhs = rhs;
    rhs = temp;
   }
  }

  static bool DoubleEqual(double a, double b)
  {
   double diff = Math.Abs(a - b);
   if (diff < AbsoluteError)
    return true;
   return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));
  }

  static dynamic abs(dynamic num)
  {
   return Math.Abs(num);
  }

  static dynamic max(dynamic a, dynamic b)
  {
   return Math.Max(a, b);
  }

  static void For(int start, int end, Action method)
  {
   for (int i = start; i < end; i++)
   {
    method.Invoke();
   }
  }

  static void For(int start, int end, Action<int> method, int i)
  {
   for (i = start; i < end; i++)
   {
    method.DynamicInvoke(i);
   }
  }

  static int C(int n, int k)
  {
   return P(n, k) / Factorial(k);
  }

  static int P(int n, int r)
  {
   return Factorial(n) / Factorial(n - r);
  }

  static int Factorial(int n)
  {
   if (factorial.Count <= n)
    factorial.Add(Factorial(n - 1) * n);
   return factorial[n];
  }

  static bool IsEven(int a)
  {
   return (a % 2) == 0;
  }

  static bool IsOdd(int a)
  {
   return !IsEven(a);
  }

  static int powmod(int a, int b)
  {
   if (b == 0)
    return 1;
   if (b == 1)
    return a;
   int i = powmod(a, b / 2);
   i *= i;
   i %= mod;
   if (b % 2 == 0)
    return i;
   else
    return ((i * a) % mod);
  }
#endregion
 }
#region SolverUtils
#endregion
#region Data Structure
#endregion
#region Algorithm
#endregion
#region Library Method/Fields
#region Members for Internal Support
#endregion Members for Internal Support
#region Public Properties
#endregion Public Properties
#region Public Instance Methods
#endregion Public Instance Methods
#region Constructors
#endregion Constructors
#region Public Static Methods
#endregion Public Static Methods
#region Operator Overloads
#endregion Operator Overloads
#region explicit conversions from BigRational
#endregion explicit conversions from BigRational
#region implicit conversions to BigRational
#endregion implicit conversions to BigRational
#region serialization
#endregion serialization
#region instance helper methods
#endregion instance helper methods
#region static helper methods
#endregion static helper methods
#region Exceptions
#endregion
#endregion
}

#region Libraries
namespace GenericArithmetic
{
 public class Vector<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public T X
  {
   get;
   set;
  }

  public T Y
  {
   get;
   set;
  }

  public Vector(T x, T y)
  {
   X = x;
   Y = y;
  }

  public override bool Equals(object obj)
  {
   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Vector<T> a, Vector<T> b)
  {
   return EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y);
  }

  public static bool operator !=(Vector<T> a, Vector<T> b)
  {
   return !(EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y));
  }

  public static Vector<T> operator !(Vector<T> a)
  {
   return new Vector<T>(Calculator.Difference(new Number<T>(default (T)), a.X), Calculator.Difference(new Number<T>(default (T)), a.Y));
  }

  public static Vector<T> operator +(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));
  }

  public static Vector<T> operator -(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));
  }
 }

 public class Matrix<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public int W
  {
   get;
   set;
  }

  public int H
  {
   get;
   set;
  }

  public int rows
  {
   get
   {
    return H;
   }

   set
   {
    H = value;
   }
  }

  public int cols
  {
   get
   {
    return W;
   }

   set
   {
    W = value;
   }
  }

  public T[, ] Map
  {
   get;
   set;
  }

  public T this[int x, int y]
  {
   get
   {
    return Map[x, y];
   }

   set
   {
    Map[x, y] = value;
   }
  }

  public Matrix(T[, ] map)
  {
   Map = map;
   W = map.GetLength(0);
   H = map.GetLength(1);
  }

  public Matrix(int w, int h, T defaultValue = default (T))
  {
   W = w;
   H = h;
   Map = new T[W, H];
  }

  public override bool Equals(object obj)
  {
   if (obj is Matrix<T>)
   {
    return this == (Matrix<T>)obj;
   }

   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return ret;
  }

  public static bool operator !=(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return !ret;
  }

  public static Matrix<T> operator +(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator -(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator *(Matrix<T> a, Matrix<T> b)
  {
   if (a.cols != b.rows)
    throw new FormatException("Cannot multiply : a.W = " + a.W.ToString() + " with b.H = " + b.H.ToString());
   else
   {
    Matrix<T> R = new Matrix<T>(a.rows, b.cols);
    for (int i = 0; i < R.rows; i++)
     for (int j = 0; j < R.cols; j++)
      for (int k = 0; k < a.cols; k++)
      {
       R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));
      }

    return R;
   }
  }
 }

 public static class Calculator
 {
  public static T Sum<T>(T a, T b)
  {
   return Number<T>.Sum(a, b);
  }
 }

 public interface ICalculator<T>
 {
  T Sum(T a, T b);
  T Difference(T a, T b);
  int Compare(T a, T b);
  T Multiply(T a, T b);
  T Divide(T a, T b);
  T Divide(T a, int b);
 }

 struct Int32Calculator : ICalculator<Int32>
 {
  public Int32 Sum(Int32 a, Int32 b)
  {
   return a + b;
  }

  public Int32 Difference(Int32 a, Int32 b)
  {
   return a - b;
  }

  public int Compare(Int32 a, Int32 b)
  {
   return Difference(a, b);
  }

  public int Multiply(Int32 a, Int32 b)
  {
   return a * b;
  }

  public int Divide(Int32 a, Int32 b)
  {
   return a / b;
  }
 }

 struct Int64Calculator : ICalculator<Int64>
 {
  public Int64 Sum(Int64 a, Int64 b)
  {
   return a + b;
  }

  public Int64 Difference(Int64 a, Int64 b)
  {
   return a - b;
  }

  public int Compare(Int64 a, Int64 b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Int64 Multiply(Int64 a, Int64 b)
  {
   return a * b;
  }

  public Int64 Divide(Int64 a, Int64 b)
  {
   return a / b;
  }

  public Int64 Divide(Int64 a, int b)
  {
   return a / b;
  }
 }

 struct SingleCalculator : ICalculator<Single>
 {
  public Single Sum(Single a, Single b)
  {
   return a + b;
  }

  public Single Difference(Single a, Single b)
  {
   return a - b;
  }

  public int Compare(Single a, Single b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Single Multiply(Single a, Single b)
  {
   return a * b;
  }

  public Single Divide(Single a, Single b)
  {
   return a / b;
  }

  public Single Divide(Single a, int b)
  {
   return a / b;
  }
 }

 struct DoubleCalculator : ICalculator<double>
 {
  public double Sum(double a, double b)
  {
   return a + b;
  }

  public double Difference(double a, double b)
  {
   return a - b;
  }

  public int Compare(double a, double b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public double Multiply(double a, double b)
  {
   return a * b;
  }

  public Double Divide(Double a, Double b)
  {
   return a / b;
  }

  public Double Divide(Double a, int b)
  {
   return a / b;
  }
 }

 struct StringCalculator : ICalculator<string>
 {
  public string Sum(string a, string b)
  {
   return a + b;
  }

  public string Difference(string a, string b)
  {
   if (b.Length < a.Length)
   {
    return a.Substring(0, b.Length);
   }
   else
   {
    return "";
   }
  }

  public int Compare(string a, string b)
  {
   return a.CompareTo(b);
  }

  public string Multiply(string a, string b)
  {
   if (a.Length == 1 && b.Length == 1)
   {
    return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + "";
   }

   int bigLength = Math.Max(a.Length, b.Length);
   while (a.Length < bigLength)
   {
    a = " " + a;
   }

   while (b.Length < bigLength)
   {
    b = " " + b;
   }

   string result = "";
   for (int i = 0; i < bigLength; i++)
   {
    Number<string> numA = a[i] + "";
    Number<string> numB = b[i] + "";
    result += numA * numB;
   }

   return result;
  }

  public String Divide(String a, String b)
  {
   return String.Format("{0} / {1}", a, b);
  }

  public String Divide(String a, int b)
  {
   return String.Format("{0} / {1}", a, b);
  }
 }

 public class Number<T>
 {
  private T value;
  public Number(T value)
  {
   this.value = value;
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

  public static Type GetCalculatorType()
  {
   Type tType = typeof (T);
   Type calculatorType = null;
   if (tType == typeof (Int32))
   {
    calculatorType = typeof (Int32Calculator);
   }
   else if (tType == typeof (Int64))
   {
    calculatorType = typeof (Int64Calculator);
   }
   else if (tType == typeof (Double))
   {
    calculatorType = typeof (DoubleCalculator);
   }
   else if (tType == typeof (string))
   {
    calculatorType = typeof (StringCalculator);
   }
   else
   {
    throw new InvalidCastException(String.Format("Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator<T> and cannot be used in generic arithmetic using type Number<T>", tType.Name));
   }

   return calculatorType;
  }

  private static ICalculator<T> fCalculator = null;
  public static ICalculator<T> Calculator
  {
   get
   {
    if (fCalculator == null)
    {
     MakeCalculator();
    }

    return fCalculator;
   }
  }

  public static void MakeCalculator()
  {
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

#region operation methods
  public static T Sum(T a, T b)
  {
   return Calculator.Sum(a, b);
  }

  public static T Difference(T a, T b)
  {
   return Calculator.Difference(a, b);
  }

  public static int Compare(T a, T b)
  {
   return Calculator.Compare(a, b);
  }

  public static T Multiply(T a, T b)
  {
   return Calculator.Multiply(a, b);
  }

  public static T Divide(T a, T b)
  {
   return Calculator.Divide(a, b);
  }

  public static T Divide(T a, int b)
  {
   return Calculator.Divide(a, b);
  }

#endregion
#region Operators
  public static implicit operator Number<T>(T a)
  {
   return new Number<T>(a);
  }

  public static implicit operator T(Number<T> a)
  {
   return a.value;
  }

  public static Number<T> operator +(Number<T> a, Number<T> b)
  {
   return Calculator.Sum(a.value, b.value);
  }

  public static Number<T> operator -(Number<T> a, Number<T> b)
  {
   return Calculator.Difference(a, b);
  }

  public static bool operator>(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) > 0;
  }

  public static bool operator <(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) < 0;
  }

  public static Number<T> operator *(Number<T> a, Number<T> b)
  {
   return Calculator.Multiply(a, b);
  }

  public static Number<T> operator /(Number<T> a, Number<T> b)
  {
   return Calculator.Divide(a, b);
  }

  public static Number<T> operator /(Number<T> a, int b)
  {
   return Calculator.Divide(a, b);
  }
#endregion
 }
}
#region DataStructures
#region IComparable implementation
#endregion
#region Model
#endregion
#region Constructors
#endregion
#region Internal
#region IEqualityComparer implementation
#endregion
#endregion
#region IGraph implementation
#endregion
#region Clique invariants
#endregion
#region Clique methods
#endregion
#region IEquatable implementation
#endregion
#endregion
#region Algorithms
#endregion
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int x1 = 0,x2=0,k=0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+')
                    x1++;
                else
                    x1--;
                if (s2[i] == '+')
                    x2++;
                if (s2[i] == '-')
                    x2--;
                if (s2[i] == '?')
                    k++;
            }
            int[,] a = new int[(int)Math.Pow(2, k),k+1];
            int res = 0;
            for (int j = 0; j < (int)Math.Pow(2, k); j++)
            {
                int y=0;
                for (int i = 0; i < k; i++)
                {
                    int l=(int)Math.Pow(2,k-1-i);
                    if(l!=1)
                    {
                        if (((j / l) % l) % 2 == 0)
                            y++;
                        else
                            y--;
                    }
                    else
                    {
                        if (j % 2 == 0)
                            y++;
                        else
                            y--;
                    }
                }
                if (y + x2 == x1)
                    res++;
            }
            Console.WriteLine(((double)res / Math.Pow(2, k)).ToString().Replace(',','.'));
           // Console.ReadKey();
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Globalization;

namespace dr2
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
#if DEBUG
        static bool _useFileInput = false;
#else
        static bool _useFileInput = false;
#endif

        static void Main(string[] args)
        {
            StreamWriter file = null;
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }

#if DEBUG
			if (!_useFileInput)
			{
				Console.SetIn(getInput());
			}
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var s = Console.ReadLine();
            var got = Console.ReadLine();
            var fp = 0;
            for (int i = 0; i < got.Length; i++)
            {
                if (s[i] == '+')
                {
                    fp++;
                }
                else
                {
                    fp--;
                }
            }

            var dp = 0;
            var ac = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (got[i] == '?')
                {
                    ac++;
                }
                else if (got[i] == '+')
                {
                    dp++;
                }
                else
                {
                    dp--;
                }
            }

            if (ac == 0)
            {
                if (dp == fp)
                {
                    Console.WriteLine(1);
                }
                else
                {
                    Console.WriteLine(0);
                }

                return;
            }

            var need = 0;
            if (dp * fp > 0)
            {
                need = Math.Abs(dp - fp);
            }
            else if (dp * fp == 0)
            {
                need = Math.Max(Math.Abs(dp), Math.Abs( fp));
            }
            else
            {
                need = Math.Abs(dp) + Math.Abs(fp);
            }

            if (ac < need)
            {
                Console.WriteLine(0);
                return;
            }

            var fa = new int[11];
            fa[0] = 1;
            for (int i = 1; i < 10 + 1; i++)
            {
                fa[i] = i * fa[i - 1];
            }

            var count = 0;
            var oc = 0;
            for (int i = 0; i <= ac; i++)
            {
                var rem = ac - i;
                count += fa[ac] / (fa[i] * fa[rem]);

                if (i - rem == need)
                {
                    oc += fa[ac] / (fa[i] * fa[rem]);
                }
            }

            var res = (double)oc / (count);
            Console.WriteLine(res.ToString(CultureInfo.InvariantCulture));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 0m ;
        decimal total = 0m;
        total = (decimal)posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = correct/total;
        Console.WriteLine(prob.ToString(new NumberFormatInfo {NumberDecimalSeparator = "."}));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            int sum = 0, n = 0;
            char[] aux = Console.ReadLine().ToCharArray();
            for (int i = 0; i < aux.Length; i++) {
                if (aux[i] == '?') {
                    n++;
                } else if (aux[i] == '+') {
                    sum++;
                } else {
                    sum--;
                }
            }
            aux = Console.ReadLine().ToCharArray();
            for (int i = 0; i < aux.Length; i++) {
                if (aux[i] == '?') {
                    n++;
                } else if (aux[i] == '+') {
                    sum--;
                } else {
                    sum++;
                }
            }
            if (sum < 0){
                sum = -sum;
            }
            double[] fact = new double[11];
            fact[0] = 1.0;
            for (int i = 1; i <= 10; i++) {
                fact[i] = fact[i - 1] * i;
            }
            double ans = 0.0;
            int test = n - sum;
            if (test % 2 == 0) {
                test /= 2;
                test += sum;
                if (n == 0) {
                    if (sum == 0) {
                        ans = 1.0;
                    }
                } else if (test <= n) {
                    ans = (fact[n]/(fact[test]*fact[n-test]))/(1 << n);
                }
            }
            Console.Write(ans.ToString(CultureInfo.CreateSpecificCulture("en-GB")));
            //Console.ReadKey();
        }
    }
}

using System;
using System.Globalization;
using System.IO;
using System.Runtime.Hosting;

namespace CF272
{
    class Program
    {
        private static string s1 = "";
        private static string s2 = "";
        private static long sourceResult;
        private static long count = 0L;
        private static long countSource = 0L;
        static void Main(string[] args)
        {
            Solution(Console.In, Console.Out);
        }

        static void Solution(TextReader sr, TextWriter sw)
        {
            s1 = sr.ReadLine();
            s2 = sr.ReadLine();
            sourceResult = Result(s1.ToCharArray());
            Solution(new char[s2.Length], s2.Length, -1);
            double result = (double)count / countSource;
            Console.WriteLine(result.ToString("F10", CultureInfo.InvariantCulture));
        }

        static void ProcessSolution(char[] a, int n, int k)
        {
            long result = Result(a);
            countSource++;
            if (result == sourceResult)
            {
                count++;
            }
        }

        static long Result(char[] a)
        {
            long result = 0L;
            foreach (var ch in a)
            {
                if (ch == '+')
                {
                    result += 1;
                }
                else
                {
                    result -= 1;
                }
            }
            return result;
        }

        static bool IsSolution(char[] a, int n, int k)
        {
            return k + 1 == n;
        }

        static void Solution(char[] a, int n, int k)
        {
            if (IsSolution(a, n, k))
            {
                ProcessSolution(a, n, k);
            }
            else
            {
                k++;
                if (s2[k] == '?')
                {
                    a[k] = '+';
                    Solution(a, n, k);
                    a[k] = '-';
                    Solution(a, n, k);
                }
                else
                {
                    a[k] = s2[k];
                    Solution(a, n, k);
                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            int transmit=0;
            int reseive = 0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int count = 0;
            int count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? 1 : -1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? 1 : -1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                if (Math.Abs((transmit - reseive)) % 2 == count % 2 && (transmit - reseive) <= count && (transmit - reseive) >= -count)
                {
                    int k = (count - (transmit - reseive)) / 2;
                    double result = 1;
                    for (int z = 0; z < k; z++)
                    {
                        result *= (double)(count - z) / (z + 1);
                    }
                    Console.WriteLine((result / Math.Pow(2, count)).ToString("0.000000000000").Replace(',', '.'));
                }
                else
                {
                    Console.WriteLine(0);
                }

            }
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;

namespace cf
{
    public class Cf
    {
        private static void Println(int n)
        {
            Console.WriteLine(n);
        }

        private static void Println(String s)
        {
            Console.WriteLine(s);
        }

        private static void Print(int n)
        {
            Console.Write(n);
        }

        private static void Print(String s)
        {
            Console.Write(s);
        }

        public static void Main(String[] args)
        {
            B();
        }

        private static void C()
        {
        }

        private static void A()
        {
            var scanner = new MyScanner();
            var n = scanner.NextInt();
            var m = scanner.NextInt();
            var x2 = n / 2;
            var x1 = n % 2;
            var d = (m - ((x1 + x2) % m)) % m;
            x2 -= d;
            x1 += 2 * d;
            if (x2 < 0)
            {
                Print(-1);
            }
            else
            {
                Print(x1 + x2);
            }
        }

        private static void B()
        {
            var f = new int[11];
            f[0] = 1;
            for (int i = 1; i < 11; i++)
                f[i] = f[i - 1]*i;
            var scanner = new MyScanner();
            var s1 = scanner.NextString();
            var s2 = scanner.NextString();
            var p1 = s1.Count(c => c == '+') - s1.Count(c => c == '-');
            var p2 = s2.Count(c => c == '+') - s2.Count(c => c == '-');
            var d = Math.Abs(p1 - p2);
            var q = s2.Count(c => c == '?');
            if (d > q)
            {
                Print(0);
                return;
            }
            var x = q - d;
            if (x%2 == 1)
            {
                Print(0);
                return;
            }
            x /= 2;
            double pp = ((double)f[q])/(f[x]*f[q - x]);
            Print((pp/Math.Pow(2,q)).ToString().Replace(',','.'));
        }
    }

    class Pair
    {
        public int X;
        public int Y;

        Pair(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
    }
    class MyScanner
    {
        private String[] _buffer;
        private int _pos = 0;

        public int NextInt()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return int.Parse(_buffer[_pos - 1]);
        }

        public String NextString()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return _buffer[_pos - 1];
        }

        public List<int> GetIntList(int n)
        {
            var result = new List<int>(n);
            for (int i = 0; i < n; i++)
                result.Add(NextInt());
            return result;
        }

        public int[] GetIntArray(int n)
        {
            var result = new int[n];
            for (int i = 0; i < n; i++)
                result[i] = (NextInt());
            return result;
        }

    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            Console.WriteLine(res.Replace(',', '.'));

            Console.ReadLine();
        }

        static int Fact(int n)
        {
            int res = 1;
            for (int i = 2; i <= n; i++)
            {
                res *= i;
            }

            return res;
        }

        static int C(int a, int n)
        {
            return (Fact(n) / Fact(a)) / Fact(n - a);
        }

        static double GetResult(string send, string received)
        {
            int plus = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            int diff = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                    {
                        ++diff;
                        ++plus;
                    }
                    else
                        --diff;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if ( Math.Abs(incorrectdiff) > unknown - Math.Abs(diff))
                return 0.0;

            return C(plus - incorrectdiff,unknown) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;

namespace prB {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif

        static long v = 0;

        static void Perebor(int q, int dr, ref int orig) {
            if(q == 0) {
                if(dr == orig)
                    v++;
                return;
            }
            Perebor(q - 1, dr + 1, ref orig);
            Perebor(q - 1, dr - 1, ref orig);
        }

        static void Main(string[] args) {
            string s1 = reader.ReadLine();
            string s2 = reader.ReadLine();
            int orig = 0;
            foreach(char c in s1) {
                switch(c) {
                    case '+':
                        orig++;
                        break;
                    case '-':
                        orig--;
                        break;
                }
            }
            int dr = 0;
            int q = 0;
            foreach(char c in s2) {
                switch(c) {
                    case '+':
                        dr++;
                        break;
                    case '-':
                        dr--;
                        break;
                    case '?':
                        q++;
                        break;
                }
            }

            Perebor(q, dr, ref orig);
            long all = (long) Math.Pow(2, q);
            double ans = v / (double) all;
            string result = ans.ToString(new NumberFormatInfo {NumberDecimalSeparator = "."});
            writer.WriteLine(result);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1.Dynamic
{
    class _476B
    {
        public static int Main()
        {
            var s1 = Console.ReadLine();
            var s2 = Console.ReadLine();
            var possible = new List<string>();
            possible.Add(s2);
            for(var i = 0; i < s2.Length; i++)
            {
                if(s2[i] == '?')
                {
                    var newAll = new List<string>();
                    for (var j = 0; j < possible.Count; j++)
                    {
                        var cur = possible[j].ToCharArray().ToArray();
                        cur[i] = '+';
                        newAll.Add(new string(cur));
                        cur[i] = '-';
                        newAll.Add(new string(cur));
                    }
                    possible = newAll;
                }
            }
            var result = 0;
            for(var i = 0; i < s1.Length; i++)
            {
                if(s1[i] == '-')
                {
                    result -= 1;
                } else
                {
                    result += 1;
                }
            }
            double good = 0;
            for(var i = 0; i < possible.Count; i++)
            {
                var res = 0;
                for(var j = 0; j < possible[i].Length; j++)
                {
                    if(possible[i][j] == '-')
                    {
                        res -= 1;
                    } else
                    {
                        res += 1;
                    }
                }
                if(res == result)
                {
                    good++;
                }
            }
            Console.WriteLine((good/possible.Count).ToString().Replace(',', '.'));
            return 0;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1.Dynamic
{
    class _476B
    {
        public static int Main()
        {
            var s1 = Console.ReadLine();
            var s2 = Console.ReadLine();
            var possible = new List<string>();
            possible.Add(s2);
            for(var i = 0; i < s2.Length; i++)
            {
                if(s2[i] == '?')
                {
                    var newAll = new List<string>();
                    for (var j = 0; j < possible.Count; j++)
                    {
                        var cur = possible[j].ToCharArray().ToArray();
                        cur[i] = '+';
                        newAll.Add(new string(cur));
                        cur[i] = '-';
                        newAll.Add(new string(cur));
                    }
                    possible = newAll;
                }
            }
            var result = 0;
            for(var i = 0; i < s1.Length; i++)
            {
                if(s1[i] == '-')
                {
                    result -= 1;
                } else
                {
                    result += 1;
                }
            }
            double good = 0;
            for(var i = 0; i < possible.Count; i++)
            {
                var res = 0;
                for(var j = 0; j < possible[i].Length; j++)
                {
                    if(possible[i][j] == '-')
                    {
                        res -= 1;
                    } else
                    {
                        res += 1;
                    }
                }
                if(res == result)
                {
                    good++;
                }
            }
            Console.WriteLine((good/possible.Count).ToString(System.Globalization.CultureInfo.InvariantCulture));
            return 0;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

// (づ°ω°)づﾐ★゜・。。・゜゜・。。・゜☆゜・。。・゜゜・。。・゜
public class Solver
{
    public object Solve()
    {
        string s1 = ReadToken();
        string s2 = ReadToken();

        var dp = new double[21];
        dp[10] = 1;
        foreach (char c in s2)
        {
            var ndp = new double[21];
            for (int i = 1; i < 20; i++)
            {
                if (c == '+')
                    ndp[i + 1] += dp[i];
                else if (c == '-')
                    ndp[i - 1] += dp[i];
                else
                {
                    ndp[i - 1] += dp[i] / 2;
                    ndp[i + 1] += dp[i] / 2;
                }
            }
            dp = ndp;
        }

        int t = 10 + s1.Sum(c => c == '+' ? 1 : -1);
        return dp[t].ToString(CultureInfo.InvariantCulture);

        return null;
    }

    #region Main

    protected static TextReader reader;
    protected static TextWriter writer;

    static void Main()
    {
#if DEBUG
        reader = new StreamReader("..\\..\\input.txt");
        writer = Console.Out;
        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());
//        reader = new StreamReader("army.in");
//        writer = new StreamWriter("army.out");
#endif
        try
        {
            object result = new Solver().Solve();
            if (result != null)
                writer.WriteLine(result);
        }
        catch (Exception ex)
        {
#if DEBUG
            Console.WriteLine(ex);
#else
            Console.WriteLine(ex);
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }

    #endregion
}

// done
/***************************************************************************
* Title       : Dreamoon and WiFi
* URL         : http://codeforces.com/problemset/problem/476/B
* Occasion    : Codeforces Round #273 (Div. 2)
* Date        : Sep 13 2017
* Complexity  : O(n) 46ms, Space O(n)
* Author      : Atiq Rahman
* Status      : Accepted
* Notes       : input limit 10^9 requires larger data type than int
* meta        : tag-combinatories, tag-math, tag-easy
***************************************************************************/
using System;
using System.Globalization;

class ProbComb {
  int d;
  int d2;
  int q;
  double positive_count;

  // Take input strings and represent them in d, d2 and q
  public void TakeInput() {
    string s1 = Console.ReadLine();
    string s2 = Console.ReadLine();

    d = d2 = q = 0;
    positive_count = 0;
    foreach (char ch in s1)
      switch (ch) {
        case '+':
          d++; break;
        case '-':
          d--; break;
        default:
          break;
      }
    foreach (char ch in s2)
      switch (ch) {
        case '+':
          d2++; break;
        case '-':
          d2--; break;
        case '?':
          q++; break;
        default:
          break;
      }
  }

  public double GetProbability() {
    if (Math.Abs(d - d2) > q)
      return 0.0;
    Comb(d2, 0);
    double res = positive_count / (q==0?1:Math.Pow(2, q));
    return res;
  }

  public void Comb(int v, int k) {
    if (k == q) {
      if (v == d)
        positive_count++;
      return;
    }
    Comb(v + 1, k+1);
    Comb(v - 1, k+1);
  }
}

public class CF_Solution {
  public static void Main() {
    ProbComb PC = new ProbComb();
    PC.TakeInput();
    Console.WriteLine(PC.GetProbability().ToString("F12", CultureInfo.CreateSpecificCulture("en-US")));
    // Console.WriteLine(PC.GetProbability());
  }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;

namespace Solving
{
    class MyDictionary<TKey, TValue> : Dictionary<TKey, TValue> {
        public new TValue this[TKey key] {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                new Solver().Solve();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                Console.ReadKey();
            }
        }
    }

    class Solver {
        static int goodways = 0;
        static int finalpos = 0;
        public  void Solve() {
            string str1 = InputReader.ReadString(), str2 = InputReader.ReadString();
            int  currentpos = 0, allways;
            int countofvariants = 0;
            for (int i = 0; i < str1.Length; i++) {
                if (str1[i] == '+') finalpos++;
                else finalpos--;
            }
            for (int i = 0; i < str2.Length; i++) {
                if (str2[i] == '+') currentpos++;
                else if (str2[i] == '-') currentpos--;
                else if (str2[i] == '?') countofvariants++;
            }
            allways = (int)Math.Pow(2, countofvariants);
            GoodComb(currentpos, countofvariants);
            double ver= (double)goodways/(double)allways;
            string ans = String.Format("{0:f12}", ver);
            ans = ans.Replace(",", ".");
            //Console.WriteLine(goodways);
            //Console.WriteLine(allways);
            Console.Write(ans);
            //Console.ReadKey();
            }
        static void GoodComb(int cur, int countofask){
            if (countofask >= 1)
            {
                GoodComb(cur + 1, countofask - 1);
                GoodComb(cur - 1, countofask - 1);
            }
            else if (cur == finalpos) goodways++;
        }
    }

    class InputReader {
        public static int[] ReadIntArr() {
            return Console.ReadLine().Split(' ').Select(Int32.Parse).ToArray();
        }
        public static string ReadString() {
            return Console.ReadLine();
        }
        public static long[] ReadLongArr() {
            return Console.ReadLine().Split(' ').Select(Int64.Parse).ToArray();
        }
        public static double[] ReadDoubleArr() {
            return Console.ReadLine().Split(' ').Select(s => Double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }
        public static string[] ReadSplitString() {
            return Console.ReadLine().Split(' ').ToArray();
        }
        public static int ReadInt() {
            return Int32.Parse(Console.ReadLine());
        }
        public static long ReadLong() {
            return Int64.Parse(Console.ReadLine());
        }
        public static double ReadDouble() {
            return Double.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
        }
        public static int[][] ReadIntMatrix(int numberofrows) {
            int[][] matrix = new int[numberofrows][];
            for (int i = 0; i < numberofrows; i++) {
                matrix[i] = ReadIntArr();
            }
            return matrix;
        }
        public static string[] ReadStringLines(int numberoflines) {
            string[] arr = new string[numberoflines];
            for (int i = 0; i < numberoflines; i++) {
                arr[i] = Console.ReadLine().Trim();
            }
            return arr;
        }
    }

    class OutputWriter {
        public static void WriteArray<T>(IEnumerable<T> array) {
            Console.WriteLine(string.Join(" ", array));
        }
        public static void WriteLines<T>(IEnumerable<T> array) {
            foreach (var a in array) { Console.WriteLine(a); }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //int n = int.Parse(Console.ReadLine());
            //var arr = new int[n][];//Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int t = num[0];
            //int k = num[1];

            string s = Console.ReadLine();
            string t = Console.ReadLine();
            int len = s.Length;

            int original = 0;
            for(int i=0; i< len; i++)
            {
                char cur = s[i];
                if (cur == '+') original++;
                else original--;

            }

            int dre = 0;
            int cntQ = 0;
            for (int i = 0; i < len; i++)
            {
                char cur = t[i];
                if (cur == '+') dre++;
                else if(cur == '-')dre--;
                else cntQ++;
            }

            double ans = 1.0;

            if(cntQ==0 && original==dre) Console.WriteLine(ans);
            else if (cntQ == 0 && original != dre) Console.WriteLine(0.0);
            else
            {
                int dif = Math.Abs(original-dre);
                if (dif > cntQ) ans = 0.0;
                else if (dif % 2 != cntQ % 2) ans = 0.0;
                else
                {
                    double d = Math.Pow(2,cntQ);
                    double count = 0.0;
                    for(int i=0; i<(1<<cntQ); i++)
                    {
                        int tmp = i;
                        int cnt = 0;
                        while(tmp>0)
                        {
                            if ((tmp & 1) == 1) cnt++;
                            tmp >>= 1;
                        }
                        if ((cntQ-cnt) - (cnt) == dif) count++;
                    }
                    ans = count / d;
                }

                Console.WriteLine(ans.ToString(System.Globalization.CultureInfo.InvariantCulture));
            }

            //Console.WriteLine();

        }

    }

    class Segment
    {
        //public int[] arr;
        public Tuple<int, int, int, int, int>[] arr;
        int n;

        public Segment(int n)
        {
            this.n = n * 2;
            //arr = Enumerable.Range(0, n*2).ToArray();
            //arr = new int[this.n];
            arr = new Tuple<int, int, int, int, int>[this.n];
            for (int i = 0; i < this.n; i++)
            {
                arr[i] = Tuple.Create(0, 0, 0, 0, 0);
            }

        }

        public void update(int i, int x)
        {
            i = (n / 2) + i - 1;
            //arr[i] = 1;
            if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
            else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
            else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
            else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
            else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

            while (i > 0)
            {
                i = (i - 1) / 2;
                //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                //{
                //    arr[i] = arr[i*2+1];
                //}
                //else
                //{
                //    arr[i] = arr[i*2+2];
                //}
                //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                    arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                    arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                    arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                    arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
            }

        }

        //call : query(a,b, 0, 0, n)
        public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
        {
            if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
            if (a <= l && r <= b) return arr[k];
            else
            {

                var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                //if (vl.Item4 > vr.Item4)
                //{
                //    return vl;
                //}
                ////else if (vl.Item4 == vr.Item4)
                ////{
                ////    if (countA >= countB) return vr;
                ////    else return vl;
                ////}
                //else return vr;

                return Tuple.Create(vl.Item1 + vr.Item1,
   vl.Item2 + vr.Item2,
   vl.Item3 + vr.Item3,
  vl.Item4 + vr.Item4,
   vl.Item5 + vr.Item5);

                //return Math.Max(vl, vr);
                //return vl
                int countA = 0;
                int countB = 0;
                if (vl.Item1 == 0) countA++;
                if (vl.Item2 == 0) countA++;
                if (vl.Item3 == 0) countA++;
                if (vl.Item4 == 0) countA++;
                if (vl.Item5 == 0) countA++;

                if (vr.Item1 == 0) countB++;
                if (vr.Item2 == 0) countB++;
                if (vr.Item3 == 0) countB++;
                if (vr.Item4 == 0) countB++;
                if (vr.Item5 == 0) countB++;

                if ((vl.Item1 == 0 && vr.Item1 > 0))
                {
                    return vr;
                }
                else if ((vl.Item1 > 0 && vr.Item1 == 0))
                {
                    return vl;
                }
                else if ((vl.Item2 == 0 && vr.Item2 > 0))
                {
                    return vr;
                }
                else if ((vl.Item2 > 0 && vr.Item2 == 0))
                {
                    return vl;
                }
                else if ((vl.Item3 == 0 && vr.Item3 > 0))
                {
                    return vr;
                }
                else if ((vl.Item3 > 0 && vr.Item3 == 0))
                {
                    return vl;
                }
                else if ((vl.Item4 == 0 && vr.Item4 > 0))
                {
                    return vr;
                }
                else if ((vl.Item4 > 0 && vr.Item4 == 0))
                {
                    return vl;
                }
                else if ((vl.Item5 == 0 && vr.Item5 > 0))
                {
                    return vr;
                }
                else if ((vl.Item5 > 0 && vr.Item5 == 0))
                {
                    return vl;
                }

                if (vl.Item4 > vr.Item4)
                {
                    return vl;
                }
                else if (vl.Item4 == vr.Item4)
                {
                    if (countA >= countB) return vr;
                    else return vl;
                }
                else return vr;

                //if (countA <= countB) return vl;
                //else return vr;
            }
        }

    }

    class UnionFind
    {
        public int[] path;

        public UnionFind(int n)
        {
            path = new int[n];

            for (int i = 0; i < n; i++)
            {
                path[i] = i;
            }

        }

        private int root(int i)
        {
            while (i != path[i])
            {
                path[i] = path[path[i]];
                i = path[i];
            }
            return i;
        }

        public bool find(int p, int q)
        {
            return root(p) == root(q);
        }

        public void unite(int p, int q)
        {
            int i = root(p);
            int j = root(q);
            path[i] = j;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
public class Codeforces
{
    #region Main
    protected static TextReader reader;
    protected static TextWriter writer;
    public static long Fact(long num)
    {
        long factorial = 1;
        for (int i = 1; i <= num; i++)
        {
            factorial *= i;
        }
        return factorial;
    }
    static void Main()
    {
        reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
        var s1 = ReadToken();
        var s2 = ReadToken();
        var plus1 = s1.Count(c => c == '+');
        var plus2 = s2.Count(c => c == '+');
        double diffPlus = Math.Abs(plus1 - plus2);
        double qMark = s2.Count(c => c == '?');
        if (plus1 == plus2 && plus2 != 0 && qMark == 0)
        {
            writer.WriteLine("1.000000000");
            reader.Close();
            writer.Close();
            return;
        }
        if (diffPlus > qMark || (plus2 > plus1))
        {
            writer.WriteLine("0.000000000");
            reader.Close();
            writer.Close();
            return;
        }
        //if (diffPlus == qMark)
        //{
        //    writer.WriteLine("{0}", Math.Pow(0.5, qMark).ToString("F12", CultureInfo.InvariantCulture));
        //    reader.Close();
        //    writer.Close();
        //    return;
        //}
        var powTwo = 1 << (int)qMark;
        double comb = Fact((long)qMark) /
            (Fact((long)diffPlus) * Fact((long)(qMark - diffPlus)));
        writer.WriteLine("{0}", (comb / powTwo).ToString("F12", CultureInfo.InvariantCulture));
        reader.Close();
        writer.Close();
    }
    #endregion
    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string ReadToken()
    {
        while (currentLineTokens.Count == 0)
            currentLineTokens = new Queue<string>(ReadAndSplitLine());
        return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(ReadToken());
    }

    public static long ReadLong()
    {
        return long.Parse(ReadToken());
    }

    public static double ReadDouble()
    {
        return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }
    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][];
        for (int i = 0; i < numberOfRows; i++)
            matrix[i] = ReadIntArray();
        return matrix;
    }
    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows);
        int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++)
        {
            ret[i] = new int[numberOfRows];
            for (int j = 0; j < numberOfRows; j++)
                ret[i][j] = matrix[j][i];
        }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity];
        for (int i = 0; i < quantity; i++)
            lines[i] = reader.ReadLine().Trim();
        return lines;
    }
    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write<T>(params T[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array)
            writer.WriteLine(a);
    }
    private static int Next()
    {
        int c;
        int res = 0;
        do
        {
            c = reader.Read();
            if (c == -1)
                return res;
        } while (c != '-' && (c < '0' || c > '9'));
        int sign = 1;
        if (c == '-')
        {
            sign = -1;
            c = reader.Read();
        }
        res = c - '0';
        while (true)
        {
            c = reader.Read();
            if (c < '0' || c > '9')
                return res * sign;
            res *= 10;
            res += c - '0';
        }
    }
    #endregion
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

namespace ReadTemplate
{
    public class Solver
    {
        public static void Solve()
        {
            var s = Reader.ReadLine();
            var right = 20 + s.Count(c => c == '+') - s.Count(c => c == '-');
            s = Reader.ReadLine();
            var p = new double[50, 50];
            p[0, 20] = 1;
            for (int i = 0; i < s.Length; i++)
            {
                switch (s[i])
                {
                    case '+':
                        for (int j = 1; j < 49; j++)
                        {
                            p[i + 1, j + 1] += p[i, j];
                        }
                        break;
                    case '-':
                        for (int j = 1; j < 49; j++)
                        {
                            p[i + 1, j - 1] += p[i, j];
                        }
                        break;
                    default:
                        for (int j = 1; j < 49; j++)
                        {
                            p[i + 1, j - 1] += p[i, j] / 2;
                            p[i + 1, j + 1] += p[i, j] / 2;
                        }
                        break;
                }
            }
            Writer.Write(p[s.Length, right].ToString(CultureInfo.InvariantCulture));
        }

        public static void Main()
        {
            Reader = Console.In; Writer = Console.Out;
            //Reader = File.OpenText("input.txt"); Writer = File.CreateText("output.txt");

            Solve();

            Reader.Close();
            Writer.Close();
        }

        #region Read/Write

        private static TextReader Reader;

        private static TextWriter Writer;

        private static Queue<string> CurrentLineTokens = new Queue<string>();

        private static string[] ReadAndSplitLine()
        {
            return Reader.ReadLine().Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
        }

        public static string ReadToken()
        {
            while (CurrentLineTokens.Count == 0)
                CurrentLineTokens = new Queue<string>(ReadAndSplitLine());
            return CurrentLineTokens.Dequeue();
        }

        public static int ReadInt()
        {
            return int.Parse(ReadToken());
        }

        public static long ReadLong()
        {
            return long.Parse(ReadToken());
        }

        public static double ReadDouble()
        {
            return double.Parse(ReadToken(), CultureInfo.InvariantCulture);
        }

        public static int[] ReadIntArray()
        {
            return ReadAndSplitLine().Select(int.Parse).ToArray();
        }

        public static long[] ReadLongArray()
        {
            return ReadAndSplitLine().Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
        }

        public static int[][] ReadIntMatrix(int numberOfRows)
        {
            int[][] matrix = new int[numberOfRows][];
            for (int i = 0; i < numberOfRows; i++)
                matrix[i] = ReadIntArray();
            return matrix;
        }

        public static string[] ReadLines(int quantity)
        {
            string[] lines = new string[quantity];
            for (int i = 0; i < quantity; i++)
                lines[i] = Reader.ReadLine().Trim();
            return lines;
        }

        public static void WriteArray<T>(IEnumerable<T> array)
        {
            Writer.WriteLine(string.Join(" ", array));
        }

        #endregion
    }
}

#region imports
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

#endregion

namespace CodeForces
{
    class Problem
    {
        const bool IsContest = true;

        private void Solve()
        {
            var dest = _.NextToken().ToCharArray().Select(x => x == '+' ? 1 : -1).Sum();
            var input = _.NextToken().ToCharArray();
            var tempDest = input.Select(x => x == '+' ? 1 : (x == '-' ? -1 : 0)).Sum();
            var nq = input.Count(x => x == '?');
            _.WriteLine(Answer(nq, Math.Abs(dest - tempDest)).ToString("F9", CultureInfo.InvariantCulture));
        }

        decimal Answer(int n, int d)
        {
            return (n - d) % 2 == 0 && Math.Abs(n) >= Math.Abs(d) ? BinomialProb(n, Math.Abs((n - d) / 2)) : 0;
        }

        decimal BinomialProb(int n, int k)
        {
            if (n == 0) return 1;
            return k > n ? 0 : Divide(BinCoef(n, k), BigInteger.Pow(2, n));
        }

        private decimal Divide(BigInteger x, BigInteger y)
        {
            var gcd = BigInteger.GreatestCommonDivisor(x, y);
            x = x / gcd;
            y = y / gcd;
            return (decimal)x / (decimal)y;
        }

        BigInteger BinCoef(int n, int k)
        {

            return Prod(k + 1, n) / Prod(2, n - k);
        }

        BigInteger Prod(int s, int t)
        {
            var result = BigInteger.One;
            for (var i = s; i <= t; i++)
            {
                result *= i;
            }
            return result;
        }

        #region shit
        private readonly InOut _ = new InOut(IsContest);
        static void Main(string[] args)
        {
            var p = new Problem();
            p.Solve();
            p._.Close();
        }
    }
    class InOut
    {
        private const string InputFile = "input.txt";
        private const string OutputFile = "output.txt";
        public StreamWriter Cout { get; private set; }
        public StreamReader Cin { get; private set; }
        private void SetConsoleIo()
        {
            Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));
            Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));
        }
        private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }
        public InOut() { SetConsoleIo(); }
        public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }
        public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }
        public void WriteLine(object x) { Cout.WriteLine(x); }
        public void Close() { Cin.Close(); Cout.Close(); }
        public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }
        private int _pos;
        private string[] _tokens;

        private string[] NextStringArray() { return Cin.ReadLine().Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }
        public string NextToken()
        {
            while (_tokens == null || _pos == _tokens.Length)
            {
                // ReSharper disable once PossibleNullReferenceException
                _tokens = NextStringArray();
                _pos = 0;
            }
            return _tokens[_pos++];
        }
        public int NextInt() { return int.Parse(NextToken()); }
        public long NextLong() { return long.Parse(NextToken()); }
        public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }
        public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }
        public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

namespace codeforces
{
	class Program
	{
		public class User
		{
			public int c;

			public int r;
		}

		public class Point
		{
			public int x;

			public double p;
		}

		public class Comparer : IComparer<User>
		{
			public int Compare(User x, User y)
			{
				if (x.c < y.c || (x.c == y.c && x.r < y.r))
					return -1;
				return 1;
			}
		}

		public static long getGcd(long a, long b)
		{
			if (b == 0)
				return a;
			return getGcd(b, a % b);
		}

		public static void WriteYESNO(bool x, string yes = "YES", string no = "NO")
		{
			if (x)
				Console.WriteLine(yes);
			else
			{
				Console.WriteLine(no);
			}
		}

		public static string GetString()
		{
			return Console.ReadLine();
		}

		public static List<int> getList()
		{
			var s = Console.ReadLine();
			return s.Split(' ').Select(int.Parse).ToList();
		}

		public static int Min(int x, int y)
		{
			return Math.Min(x, y);
		}

		public static int Max(int x, int y)
		{
			return Math.Max(x, y);
		}

		public static int Abs(int x)
		{
			return Math.Abs(x);
		}

		public static int getInt()
		{
			var s = Console.ReadLine();
			return int.Parse(s);
		}

		public static bool Equal(int x, int y, int x1, int y1)
		{
			return x == x1 && y == y1;
		}

		public class Vertex
		{
			public List<int> edges;

			public int ct;

			public Vertex()
			{
				ct = 0;
				edges = new List<int>();
				for (var i = 0; i < 26; ++i)
					edges.Add(0);
			}
		}

		private static void Main(string[] args)
		{
/*			var input = new StreamReader("input.txt");
			var output = new StreamWriter("output.txt");*/

			var s = GetString();
			var s1 = GetString();
			var ans = new List<Point>();
			ans.Add(new Point {x = 0, p = 1});
			var cur = 0;
			for (var i = 0; i < s.Length; ++i)
			{
				if (s[i] == '+')
					cur++;
				else
				{
					cur--;
				}
			}
			for (var i = 0; i < s1.Length; ++i)
			{
				var ans1 = new List<Point>();
				for (var j = 0; j < ans.Count; ++j)
				{
					if (s1[i] == '+')
						ans1.Add(new Point {x = ans[j].x + 1, p = ans[j].p});
					if (s1[i] == '-')
						ans1.Add(new Point { x = ans[j].x - 1, p = ans[j].p });
					if (s1[i] == '?')
					{
						ans1.Add(new Point {x = ans[j].x + 1, p = ans[j].p / 2});
						ans1.Add(new Point { x = ans[j].x - 1, p = ans[j].p / 2 });
					}
				}
				ans.Clear();
				ans.AddRange(ans1);
			}
			double sum = 0;
			for (var i = 0; i < ans.Count; ++i)
				if (ans[i].x == cur)
					sum += ans[i].p;
			Console.WriteLine(sum.ToString().Replace(',', '.'));
			/*			input.Close();
			output.Close();*/
		}
	}
}

using System;
using System.Linq;
using System.Text;
using System.Collections.Generic;

namespace ConsoleApp
{
    public class Program
    {
        public static void Main()
        {
            // int n = Convert.ToInt32(Console.ReadLine());
            // int[] array = Array.ConvertAll(Console.ReadLine().Split(' '), Convert.ToInt32);
            // StringBuilder stringBuilder = new StringBuilder();
            // for (int t = Convert.ToInt32(Console.ReadLine()); t > 0; t--)
            // {
            // }

            string input = Console.ReadLine();
            int offset = 0;
            foreach (var item in input)
            {
                if (item == '+')
                {
                    offset++;
                }
                else
                {
                    offset--;
                }
            }
            input = Console.ReadLine();
            int qCount = 0;
            foreach (var item in input)
            {
                if (item == '+')
                {
                    offset--;
                }
                else
                {
                    if (item == '-')
                    {
                        offset++;
                    }
                    else
                    {
                        qCount++;
                    }
                }
            }
            if (offset < 0)
            {
                offset = -offset;
            }
            if (offset > qCount)
            {
                Console.WriteLine("0");
            }
            else
            {
                Console.WriteLine(factorial(qCount) / factorial(offset + (qCount - offset) / 2) / factorial(qCount - offset - (qCount - offset) / 2) * Math.Pow(0.5, qCount));
            }

            double factorial(int n)
            {
                if (n == 0 || n == 1)
                {
                    return 1;
                }
                else
                {
                    return n * factorial(n - 1);
                }
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476B {
    class Program {
        static void Main(string[] args) {

            string str1 = Console.ReadLine();
            string str2 = Console.ReadLine();

            char[] ar1 = str1.ToCharArray();
            char[] ar2 = str2.ToCharArray();

            int n = ar1.Length;
            int ansPosition = 0;

            for (int i = 0; i < n; i++) {
                ansPosition += (ar1[i] == '+' ? 1 : -1);
            }

            int lastPosition = 0;
            int questions = 0;
            for (int i = 0; i < n; i++) {
                if (ar2[i] == '?')
                    questions++;
                else
                    lastPosition += ar2[i] == '+' ? 1 : -1;
            }

            int distance = ansPosition - lastPosition;
            double ans = 0;

            if ((distance + questions) % 2 != 0 || questions < Math.Abs(distance))
                ans = 0;
            else {
                int m = (questions + Math.Abs(distance)) / 2;
                int c = 1;

                for (int i = 0; i < m; i++) {
                    c *= questions - i;
                }
                for (int i = 2; i <= m ; i++) {
                    c /= i;
                }
                ans = (double) c / (1 << questions);
            }

            Console.WriteLine("{0:f12}", ans);

        }
    }
}

using System;

namespace _476B
{
    class Program
    {
        static void Main(string[] args)
        {
            string da = Console.ReadLine();
            string dr = Console.ReadLine();

            int[] sa = new int[3];
            int[] sb = new int[3];
            int place = 0;

            for(int i = 0; i < da.Length; ++i)
                if(da[i] == '+')
                    ++sa[0];
                else if(da[i] == '-')
                    ++sa[1];

            for(int i = 0; i < dr.Length; ++i)
                if(dr[i] == '+')
                    ++sb[0];
                else if(dr[i] == '-')
                    ++sb[1];
                else
                {
                    ++sb[2];
                    // place |= 1 << (dr.Length - i - 1);
                    place |= 1 << i;
                }

            if(da.Length != dr.Length || sa[0] - sb[0] < 0 || sa[1] - sb[1] < 0)
            {
                System.Console.WriteLine("0.0");
                return;
            }
            System.Console.WriteLine(Ways(da.Length, place, sa[0] - sb[0], sa[1] - sb[1]) * 1.0 / Math.Pow(2, sb[2]));
        }

        protected static int Ways(int idx, int place, int p, int n)
        {
            if(idx == 0)
                return 1;

            if(((place >> (idx - 1)) & 1) == 0)
                return Ways(idx - 1, place, p, n);
            int sl = 0;
            if(p > 0)
                sl = Ways(idx - 1, place, p - 1, n);
            if(n > 0)
                sl += Ways(idx - 1, place, p, n - 1);
            return sl;
        }
    }
}

using System;
using System.Globalization;

namespace CSharp
{
    public class _476B
    {
        public static void Main(string[] args)
        {
            int d = 0;
            int n = 0;

            foreach (char c in Console.ReadLine())
            {
                switch (c)
                {
                    case '+':
                        d++;
                        break;
                    case '-':
                        d--;
                        break;
                }
            }

            foreach (char c in Console.ReadLine())
            {
                switch (c)
                {
                    case '+':
                        d--;
                        break;
                    case '-':
                        d++;
                        break;
                    case '?':
                        n++;
                        break;
                }
            }

            int k = (n - d) / 2;

            Console.WriteLine((Choose(n, k) / Math.Pow(2, n)).ToString(CultureInfo.InvariantCulture));
        }

        private static int Choose(int n, int k)
        {
            if (k < 0)
            {
                return 0;
            }

            if (n - k < k)
            {
                return Choose(n, n - k);
            }

            int result = 1;

            for (int i = 1; i <= k; i++)
            {
                result = result * (n + 1 - i) / i;
            }

            return result;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string signal = Console.ReadLine();
        string inner = Console.ReadLine();
        int[] plus = new int[2] { signal.Count(z => z == '+'), inner.Count(z => z == '+') };
        int[] minus = new int[2] { signal.Count(z => z == '-'), inner.Count(z => z == '-') };
        int qMark = inner.Count(z => z == '?');
        double ans = 0;
        if(qMark == 0)
        {
            if (plus[0] == plus[1] && minus[0] == minus[1]) ans = 1;
            else ans = 0;
        }
        else
        {
            if(plus[0] >= plus[1] && minus[0] >= minus[1])
            {
                ans = (Factorial(qMark) / (Factorial(qMark - (plus[0] - plus[1])) * Factorial(plus[0] - plus[1]))) / Math.Pow(2,qMark);
            }
        }

        Console.WriteLine("{0:F12}",ans);
     }

    static double Factorial(int t)
    {
        int ans = 1;
        for(int i = 1; i <= t; ++i)
        {
            ans *= i;
        }
        return (double)ans;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
public class GFG
{
    public static void Main()
    {
        List<int> ans = new List<int>();
        var s = Console.ReadLine();
        var t = Console.ReadLine();

        int sum = 0;

        for (int i = 0; i < s.Length; i++)
        {
            if (s[i] == '+')
                sum++;
            if (s[i] == '-')
                sum--;
        }

        var ansLis = new List<int>();
        Sum(t, 0, ansLis, 0);

        var find = ansLis.Where(x => x == sum).Count();

        Console.Write(find / (ansLis.Count * 1.0));

    }

    public static void Sum(string s, int i, List<int> sumList, int sum)
    {
        if (i >= s.Length)
        {
            sumList.Add(sum);
            return;
        }

        if (s[i] == '+')
        {
            sum++;
            Sum(s, i + 1, sumList, sum);
        }
        if (s[i] == '-')
        {
            sum--;
            Sum(s, i + 1, sumList, sum);
        }

        if (s[i] == '?')
        {
            var ss = sum;
            var tt = sum;
            ss = ss + 1;
            Sum(s, i + 1, sumList, ss);
            tt = tt - 1;
            Sum(s, i + 1, sumList, tt);
        }

    }
}

using System;

namespace DreamoonAndWifi
{
    class BC
    {
        public static long combination(long n, long r)
        {
            long i;
            long ans;
            long x;
            long k = 1;

            x = Math.Max(r, n - r);
            ans = 1;
            for (i = n; i > x; i--)
            {
                ans = ans * i;
                ans = ans / k;
                k++;
            }
            return ans;

        }
    }
    class Dreamoon
    {
        string initial;
        string recieved;
        int iPlus = 0; int iMinus = 0;
        int rPlus = 0; int rMinus = 0; int rQuest = 0;
        double prob = 0;
        int questAsPlus = 0;
        int questAsMinus = 0;
        string result;
        int endPosition = 0;
        int endPositionR = 0;

        public void countProbability()
        {
            initial = Console.ReadLine();
            recieved = Console.ReadLine();

            for (int i = 0; i < initial.Length; i++)
            {
                switch (initial[i])
                {
                    case '+':
                        iPlus++;
                        endPosition++;
                        break;
                    case '-':
                        iMinus++;
                        endPosition--;
                        break;
                    default:
                        break;
                }
                switch (recieved[i])
                {
                    case '+':
                        rPlus++;
                        endPositionR++;
                        break;
                    case '-':
                        rMinus++;
                        endPositionR--;
                        break;
                    case '?':
                        rQuest++;
                        break;
                    default:
                        break;
                }
            }
            int originalQuest = rQuest;
            int originalPlus = rPlus;
            int originalMinus = rMinus;

            if (rMinus == iMinus && rPlus == iPlus) prob = 1;
            else if (iMinus < rMinus || iPlus < rPlus) prob = 0;
            else
            {
                if (iMinus > rMinus)
                {
                    while (iMinus > rMinus && rQuest > 0)
                    {
                        rMinus++;
                        rQuest--;
                        questAsMinus++;
                    }
                }
                if (iPlus > rPlus)
                {
                    while (iPlus > rPlus && rQuest > 0)
                    {
                        rPlus++;
                        rQuest--;
                        questAsPlus++;
                    }
                }

                if (rMinus != iMinus || rPlus != iPlus) prob = 0;
                else
                {
                    int distance = Math.Abs(endPosition - endPositionR);
                    if (endPosition < endPositionR) distance = -distance;

                    //Console.WriteLine("distance: {0}", distance);
                    //Console.WriteLine("minus: {0}",questAsMinus);
                    //Console.WriteLine("plus: {0}", questAsPlus);

                    double possibleWays = BC.combination(questAsMinus + questAsPlus, questAsPlus);
                    //Console.WriteLine("possible ways: {0}", possibleWays);

                    prob = possibleWays / Math.Pow(2, originalQuest);
                    result = prob.ToString();

                }

            }
            result = prob.ToString();
            for (int i = 0; i < result.Length; i++)
            {
                if (result[i] == ',') Console.Write('.');
                else Console.Write(result[i]);
            }
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Dreamoon d = new Dreamoon();
            d.countProbability();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            double ans = 0;
            double p1, p2, m1, m2, q2;
            p1 = s1.Count(x => x == '+');
            p2 = s2.Count(x => x == '+');
            m1 = s1.Count(x => x == '-');
            m2 = s2.Count(x => x == '-');
            if (s2.IndexOf('?') == -1)
            {
                if (p1 == p2 && m1 == m2)
                {
                    ans = 1.0d;
                }
                else
                    ans = 0.0d;
            }
            else
            {
                q2 = s2.Count(x => x == '?');
                if (p2 <= p1 && m2 <= m1)
                {
                    double k1 = p1 - p2;
                    double k2 = m1 - m2;
                    ans = fatorial(q2) / (fatorial(q2 - k1) * fatorial(k1));
                    //Console.WriteLine(q2 - k1);
                    //Console.WriteLine(fatorial(q2));
                    //Console.WriteLine((fatorial(q2 - k1)));
                    //Console.WriteLine(fatorial(k1));
                    ans = ans / Math.Pow(2, q2);
                }
                else
                    ans = 0.0d;
            }
            string s = ans.ToString("0.00000000000").Replace(',', '.');
            Console.WriteLine(s);
            Console.ReadLine();
        }
        private static double fatorial(double n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }

    }
}

using System;

namespace ConsoleApp1
{
    class Program
    {
		public static string drazil ="";
		public static string dreamoon="";

		public static char[] s1 = new char[drazil.ToCharArray().Length];
		public static char[] s2 = new char[dreamoon.ToCharArray().Length];

		public static int tamanhoS1, tamanhoS2;
		public static int unidade = 0, prob = 0, soma = 0;
		public static void probabilidade(int n, int posicao)
		{

			if (n == tamanhoS2)
			{
				if (posicao == unidade)
					prob++;
				soma++;
				return;
			}
			if (s2[n] == '+')
			{
				probabilidade(n + 1, posicao + 1);
			}
			else if (s2[n] == '-')
			{
				probabilidade(n + 1, posicao - 1);
			}
			else if (s2[n] == '?')
			{
				probabilidade(n + 1, posicao + 1);
				probabilidade(n + 1, posicao - 1);
			}
		}

		static void Main(string[] args)
        {
			drazil = Console.ReadLine();
			dreamoon = Console.ReadLine();

			s1 = drazil.ToCharArray();
			s2 = dreamoon.ToCharArray();

			tamanhoS1 = s1.Length;
			tamanhoS2 = s2.Length;

			for (int i = 0; i < tamanhoS1; i++)
            {
				if (s1[i] == '+')
					unidade++;
				else
					unidade--;
			}

			probabilidade(0, 0);
			Console.WriteLine ((double)(prob) / (soma));

		}
	}
}

using System;
using System.Collections.Generic;
using System.IO.Pipes;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;

namespace Codeforces
{
    public class Program
    {
        private const int MAXN = 8000;

        public class Pair
        {
            public Pair(int x, int y)
            {
                this.x = x;
                this.y = y;
            }

            public int x;
            public int y;
        }

        public static void Main(string[] args)
        {
            string line = Console.ReadLine();
            int pos = 0;

            for (int i = 0; i < line.Length; i++)
            {
                if (line[i] == '+')
                {
                    pos++;
                }
                else
                {
                    pos--;
                }
            }

            line = Console.ReadLine();
            int failedCount = 0;
            int successCount = 0;

            Pair p1 = null;
            Pair p2 = null;
            if (line[0] == '+')
            {
                p1 = new Pair(0, 1);
            }
            else if (line[0] == '-')
            {
                p2 = new Pair(0, -1);
            }
            else
            {
                p1 = new Pair(0, 1);
                p2 = new Pair(0, -1);
            }

            Stack<Pair> stack = new Stack<Pair>();

            if (p1 != null)
            {
                stack.Push(p1);
            }
            if (p2 != null)
            {
                stack.Push(p2);
            }

            while (stack.Count != 0)
            {
                Pair p = stack.Pop();

                //Test
                if (p.x == line.Length - 1)
                {
                    if (p.y == pos)
                    {
                        successCount++;
                    }
                    else
                    {
                        failedCount++;
                    }
                }
                else
                {
                    p1 = null;
                    p2 = null;
                    if (line[p.x + 1] == '+')
                    {
                        p1 = new Pair(p.x + 1, p.y + 1);
                    }
                    else if (line[p.x + 1] == '-')
                    {
                        p2 = new Pair(p.x + 1, p.y - 1);
                    }
                    else
                    {
                        p1 = new Pair(p.x + 1, p.y + 1);
                        p2 = new Pair(p.x + 1, p.y - 1);
                    }

                    if (p1 != null)
                    {
                        stack.Push(p1);
                    }
                    if (p2 != null)
                    {
                        stack.Push(p2);
                    }
                }
            }
            Console.WriteLine(((double)successCount / (successCount + failedCount)).ToString(System.Globalization.CultureInfo.InvariantCulture));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Program
    {
        static double faktorijal(int a)
        {
            if (a == 0) return 1;
            double f = 1;
            for (int i = 2; i <= a; i++) f *= i;
            return f;
        }
        static double NnadK(int n, int k)
        {
            return faktorijal(n) / (faktorijal(k) * faktorijal(n - k));
        }
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int poz1 = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') poz1++;
                else poz1--;
            }
            int poz2 = 0;
            int brUpitnika = 0;
            for (int i = 0; i < s2.Length; i++)
            {
                if (s2[i] == '+') poz2++;
                else if (s2[i] == '-') poz2--;
                else brUpitnika++;
            }
            if (brUpitnika == 0 && poz1 == poz2)
            {
                Console.WriteLine(1);
                return;
            }
            double nepovoljniSlucajevi = 1;
            for (int i = 0; i < brUpitnika; i++) nepovoljniSlucajevi *= 2;
            double povoljniSlucajevi = 0;
            for (int i = 0; i <= brUpitnika; i++)
            {
                int slucaj = i - (brUpitnika - i);
                if (poz2 + slucaj == poz1)
                {
                    povoljniSlucajevi += NnadK(brUpitnika, i);
                    break;
                }
            }
            Console.WriteLine((povoljniSlucajevi / nepovoljniSlucajevi).ToString().Replace(',', '.'));
        }
    }
}

using System;
using System.Linq;
public class Reader
{
    public static int[] ReadArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt32(m));
    }

    public static int ReadInt()
    {
        return Convert.ToInt32(Console.ReadLine());
    }

    public static string ReadStr()
    {
        return Console.ReadLine();
    }

    public static long ReadLong()
    {
        return Convert.ToInt64(Console.ReadLine());
    }

    public static long[] ReadLongArray()
    {
        return Array.ConvertAll(Console.ReadLine().Split(' '), m => Convert.ToInt64(m));

    }
}
class Program
{
    static void Main(string[] args) => new CF().Solve();

}
public class CF
{

    public void Solve()
    {

        var s = Reader.ReadStr();
        var t = Reader.ReadStr();

        int loc = 0;

        foreach(var ch in s)
        {
            if (ch == '+') loc++;
            else loc--;
        }

        int loc2 = 0,blank = 0;

        foreach(var ch in t)
        {
            if (ch == '+') loc2++;
            else if (ch == '-') loc2--;
            else blank++;
        }

        if(blank == 0)
        {
            Console.WriteLine(loc == loc2 ? "1" : "0");
            return;
        }

        int count = 0;
        for(int i = 0; i < Math.Pow(2,blank); i++)
        {

            var numsetbits = numberofsetbits(i);
            var numunsetbits = blank - numsetbits;

            if (loc2 + (numsetbits - numunsetbits) == loc) count++;
        }

        Console.WriteLine((double) count / Math.Pow(2, blank));
    }

    public static int numberofsetbits(int n)
    {
        int count = 0;

        while(n > 0)
        {
            if ((n & 1) == 1) count++;

            n = n >> 1;
        }

        return count;
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else
            {
                int a = (unrecorg + temp) / 2, bas = Convert.ToInt32(Math.Pow(2, unrecorg));
                double div = 1;
                for (int i = 0; i < a; i++)
                    div *= unrecorg - i;
                while (a > 0)
                    div /= a--;
                Console.WriteLine((div/bas).ToString("#.#########").Replace(',','.'));
                //Console.WriteLine("div={0} bas={1}", div, bas);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Program
    {
        static void Main(string[] args)
        {
  //Teste x = new Teste();
                //x.calcula(Console.ReadLine(), Console.ReadLine());
                Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
                cod.exibe(); //Exibe o resultado em decimal
        }
    }

    class Codigo
    {
        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
            posDrazil = contaDrazil[1] - contaDrazil[0]; //Determina a posição do Drazil depois de enviar os comandos
            posDreamoon = contaDreamon[1] - contaDreamon[0]; //Determina a posição do dreamoon depois de receber os comandos
            distancia = posDrazil - posDreamoon; //Define a distância restante para Dreamoon chegar na mesma posição
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if (quantInt < Math.Abs(distancia)) //Se a quantidade de caminhos duvidosos for maior que a distância restante, a chance é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m)))); //Realiza o cálculo da combinação

                return (double)combinacao / (1 << quantInt); //Retorna o restante da formula C(Quantidade de ?, m) / 2 ^ quantidade de ?
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }

}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };
            int pre = receive.Count(r => r == '?');

            double prob = 0;

            if (pre == 0)
            {
                bool total = pos[0] == pos[1] && neg[0] == neg[1];
                prob = total ? 1 : 0;
            }
            else
            {
                if (pos[0] >= pos[1] && neg[0] >= neg[1])
                {
                    prob = ((double)Factorial(pre) / (Factorial(pre - (pos[0] - pos[1])) * Factorial(pos[0] - pos[1]))) / Math.Pow(2, pre);
                }
            }

            Console.WriteLine("{0:N12}", prob);
            //Console.ReadKey();
        }

        private static int Factorial(int num)
        {
            int total = 1;

            if (num == 0)
                return 1;

            for (int i = 1; i <= num; i++)
            {
                total *= i;
            }
            return total;
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    //class Teste
    //{
    //    public Array dreamoon;
    //    public Array drazil;
    //    int posResposta = 0;
    //    int posFinal = 0;
    //    int numInterrogacao = 0;

    //    public void calcula(string x, string y)
    //    {
    //        dreamoon = x.ToArray();
    //        drazil = y.ToArray();

    //        for (int i = 0; i < dreamoon.Length; i++)
    //        {
    //            if (dreamoon.GetValue(i).ToString() == "+")
    //                posResposta++;
    //            else
    //                posResposta--;
    //        }

    //        for (int i = 0; i < dreamoon.Length; i++)
    //        {
    //            if (drazil.GetValue(i).ToString() == "?")
    //                numInterrogacao++;
    //            else if (drazil.GetValue(i).ToString() == "+")
    //                posFinal++;
    //            else
    //                posFinal--;
    //        }

    //        int distancia = posResposta - posFinal;
    //        double resposta;
    //        if ((distancia + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distancia)) //can't reach the destination no matter how
    //            resposta = 0;
    //        else
    //        {

    //        }

    //        Console.WriteLine(resposta);
    //    }
    //}
    class Codigo
    {
        //Iniciando as variáveis dreamoon e drazil
        private string dreamoon;
        private string drazil;

        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (dreamoon.Substring(i, 1) == "+")
                    posDreamoon++;
                else if (dreamoon.Substring(i, 1) == "-")
                    posDreamoon--;
            }

            for (int i = 0; i < drazil.Length; i++)
            {
                if (drazil.Substring(i, 1) == "+")
                    posDrazil++;
                else
                    posDrazil--;
            }

            distancia = posDrazil - posDreamoon;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if (quantInt < Math.Abs(distancia)) //Se a quantidade de caminhos duvidosos for maior que a distância restante, a chance é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m))));

                return (double)combinacao / (1 << quantInt);
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            //Teste x = new Teste();
            //x.calcula(Console.ReadLine(), Console.ReadLine());
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Codigo
    {
        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
            posDrazil = contaDrazil[1] - contaDrazil[0]; //Determina a posição do Drazil depois de enviar os comandos
            posDreamoon = contaDreamon[1] - contaDreamon[0]; //Determina a posição do dreamoon depois de receber os comandos
            distancia = posDrazil - posDreamoon; //Define a distância restante para Dreamoon chegar na mesma posição
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if (quantInt < Math.Abs(distancia)) //Se a quantidade de caminhos duvidosos for maior que a distância restante, a chance é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m)))); //Realiza o cálculo da combinação

                return (double)combinacao / (1 << quantInt); //Retorna o restante da formula C(Quantidade de ?, m) / 2 ^ quantidade de ?
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            //Teste x = new Teste();
            //x.calcula(Console.ReadLine(), Console.ReadLine());
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Codigo
    {
        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos

            posDreamoon = contaDreamon[1] - contaDreamon[0];
            posDrazil = contaDrazil[1] - contaDrazil[0];
            //for (int i = 0; i < dreamoon.Length; i++) //Esse for realiza a cont
            //{
            //    if (dreamoon.Substring(i, 1) == "+")
            //        posDreamoon++;
            //    else if (dreamoon.Substring(i, 1) == "-")
            //        posDreamoon--;
            //}

            //for (int i = 0; i < drazil.Length; i++)
            //{
            //    if (drazil.Substring(i, 1) == "+")
            //        posDrazil++;
            //    else
            //        posDrazil--;
            //}

            distancia = posDrazil - posDreamoon;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if (quantInt < Math.Abs(distancia)) //Se a quantidade de caminhos duvidosos for maior que a distância restante, a chance é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m))));

                return (double)combinacao / (1 << quantInt);
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            //Teste x = new Teste();
            //x.calcula(Console.ReadLine(), Console.ReadLine());
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

#region Usings
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

using static System.Math;
#endregion

// https://codeforces.com/problemset/problem/476/B
public class B___Dreamoon_and_WiFi
{
    public static long combination(long n, long r)
    {
        long i;
        long ans;
        long x;
        long k = 1;

        x = Math.Max(r, n - r);
        ans = 1;
        for (i = n; i > x; i--)
        {
            ans = ans * i;
            ans = ans / k;
            k++;
        }
        return ans;

    }

    private static void Solve()
    {
        string initial = Read();
        string received = Read();

        int iPlus = 0, iMinus = 0;
        int rPlus = 0, rMinus = 0, rQuest = 0;
        double prob = 0;
        int questAsPlus = 0;
        int questAsMinus = 0;
        string result;
        int endPosition = 0;
        int endPositionR = 0;

        for (int i = 0; i < initial.Length; i++)
        {
            switch (initial[i])
            {
                case '+':
                    iPlus++;
                    endPosition++;
                    break;
                case '-':
                    iMinus++;
                    endPosition--;
                    break;
                default:
                    break;
            }
            switch (received[i])
            {
                case '+':
                    rPlus++;
                    endPositionR++;
                    break;
                case '-':
                    rMinus++;
                    endPositionR--;
                    break;
                case '?':
                    rQuest++;
                    break;
                default:
                    break;
            }
        }
        int originalQuest = rQuest;
        int originalPlus = rPlus;
        int originalMinus = rMinus;

        if (rMinus == iMinus && rPlus == iPlus) prob = 1;
        else if (iMinus < rMinus || iPlus < rPlus) prob = 0;
        else
        {
            if (iMinus > rMinus)
            {
                while (iMinus > rMinus && rQuest > 0)
                {
                    rMinus++;
                    rQuest--;
                    questAsMinus++;
                }
            }
            if (iPlus > rPlus)
            {
                while (iPlus > rPlus && rQuest > 0)
                {
                    rPlus++;
                    rQuest--;
                    questAsPlus++;
                }
            }

            if (rMinus != iMinus || rPlus != iPlus) prob = 0;
            else
            {
                int distance = Math.Abs(endPosition - endPositionR);
                if (endPosition < endPositionR) distance = -distance;

                //Console.WriteLine("distance: {0}", distance);
                //Console.WriteLine("minus: {0}",questAsMinus);
                //Console.WriteLine("plus: {0}", questAsPlus);

                double possibleWays = combination(questAsMinus + questAsPlus, questAsPlus);
                //Console.WriteLine("possible ways: {0}", possibleWays);

                prob = possibleWays / Math.Pow(2, originalQuest);
                result = prob.ToString();

            }

        }
        result = prob.ToString();
        for (int i = 0; i < result.Length; i++)
        {
            if (result[i] == ',') Console.Write('.');
            else Console.Write(result[i]);
        }
    }

    #region Main

    private static TextReader reader;
    private static TextWriter writer;

    public static void Main()
    {
#if DEBUG

        //reader = new StreamReader("C:\\Users\\Axel\\Desktop\\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;

        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());

        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            Solve();

            //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion Main

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string Read()
    {
        while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(Read());
    }

    public static long ReadLong()
    {
        return long.Parse(Read());
    }

    public static double ReadDouble()
    {
        return double.Parse(Read(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i]; }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write(params object[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array) writer.WriteLine(a);
    }

    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }

    private static T[] Init<T>(int size) where T : new()
    {
        var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;
    }

    #endregion Read / Write
}

using System;
using System.Linq;

namespace DreamoonAndWifi
{
    partial class DreamoonAndWifi
    {
        static int[] position = new int[21];

        static void Main(string[] args)
        {
            string s1, s2;
            int final = 10;

            s1 = ReadLine();
            s2 = ReadLine();

            foreach (char command in s1)
            {
                if (command == '+')
                    final++;
                else
                    final--;
            }

            Solve(10, 0, s2);
            Console.WriteLine("{0:0.000000000000}",(double)position[final] / (double)position.Sum());
        }

        private static void Solve(int currentPosition, int index, string commands)
        {
            if (index == commands.Length)
            {
                position[currentPosition]++;
            }
            else
            {
                switch (commands[index])
                {
                    case '+':
                        Solve(++currentPosition, index + 1, commands);
                        break;

                    case '-':
                        Solve(--currentPosition, index + 1, commands);
                        break;

                    case '?':
                        Solve(currentPosition + 1, index + 1, commands);
                        Solve(currentPosition - 1, index + 1, commands);
                        break;
                }
            }
        }
    }

    partial class DreamoonAndWifi
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

using System;
using System.Linq;

namespace DreamoonAndWifi
{
    partial class DreamoonAndWifi
    {
        static int[] position = new int[21];

        static void Main(string[] args)
        {
            string s1, s2;
            int final = 10;

            s1 = ReadLine();
            s2 = ReadLine();

            foreach (char command in s1)
            {
                if (command == '+')
                    final++;
                else
                    final--;
            }

            Solve(10, 0, s2);
            Console.WriteLine("{0:0.############}",(double)position[final] / (double)position.Sum());
        }

        private static void Solve(int currentPosition, int index, string commands)
        {
            if (index == commands.Length)
            {
                position[currentPosition]++;
            }
            else
            {
                switch (commands[index])
                {
                    case '+':
                        Solve(++currentPosition, index + 1, commands);
                        break;

                    case '-':
                        Solve(--currentPosition, index + 1, commands);
                        break;

                    case '?':
                        Solve(currentPosition + 1, index + 1, commands);
                        Solve(currentPosition - 1, index + 1, commands);
                        break;
                }
            }
        }
    }

    partial class DreamoonAndWifi
    {
        static string[] tokens = new string[0];
        static int cur_token = 0;

        static void ReadArray(char sep)
        {
            cur_token = 0;
            tokens = Console.ReadLine().Split(sep);
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int NextInt()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return int.Parse(tokens[cur_token++]);
        }

        static long NextLong()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return long.Parse(tokens[cur_token++]);
        }

        static double NextDouble()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return double.Parse(tokens[cur_token++]);
        }

        static decimal NextDecimal()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return decimal.Parse(tokens[cur_token++]);
        }

        static string NextToken()
        {
            if (cur_token == tokens.Length)
                ReadArray(' ');
            return tokens[cur_token++];
        }

        static string ReadLine()
        {
            return Console.ReadLine();
        }
    }
}

namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class p2
	{
		static void Main(string[] args)
		{
			//p1 o = new p1();
			//o.foo();

			p2 o = new p2();
			o.foo();

			//p3 o = new p3();
			//o.foo();

			Console.ReadLine();
		}
		public void foo()
		{
			string s1 = Console.ReadLine();
			string s2 = Console.ReadLine();

			fp = finalPoint(s1);
			bar(s2);
			double d = suc / n;
			Console.WriteLine(d);
		}
		private int fp;
		private double n = 0;
		private double suc = 0;
		private void bar(string s)
		{
			if (s.IndexOf('?') < 0)
			{
				n++;
				if (finalPoint(s) == fp)
					suc++;
				return;
			}

			int ind = s.IndexOf('?');
			string a = s.Substring(0, ind);
			string b = s.Substring(ind + 1);

			bar(a + "+" + b);
			bar(a + "-" + b);
		}
		private int finalPoint(string s)
		{
			int c = 0;
			for (int i = 0; i < s.Length; i++)
			{
				if (s[i] == '+')
					c++;
				else
					c--;
			}
			return c;
		}
	}
}

namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class p2
	{
		static void Main(string[] args)
		{
			//p1 o = new p1();
			//o.foo();

			p2 o = new p2();
			o.foo();

			Console.ReadLine();
		}
		public void foo()
		{
			string s1 = Console.ReadLine();
			string s2 = Console.ReadLine();

			fp = finalPoint(s1);
			bar(s2);
			Console.WriteLine(suc / n);
		}
		private int fp;
		private double n = 0;
		private double suc = 0;
		private void bar(string s)
		{
			if (s.IndexOf('?') < 0)
			{
				n++;
				if (finalPoint(s) == fp)
					suc++;
				return;
			}

			int ind = s.IndexOf('?');
			string a = s.Substring(0, ind);
			string b = s.Substring(ind + 1);

			bar(a + "+" + b);
			bar(a + "-" + b);
		}
		private int finalPoint(string s)
		{
			int c = 0;
			for (int i = 0; i < s.Length; i++)
			{
				if (s[i] == '+')
					c++;
				else
					c--;
			}
			return c;
		}
	}
}

namespace topCoder
{
	using System;
	using System.Collections.Generic;

	class p2
	{
		static void Main(string[] args)
		{
			//p1 o = new p1();
			//o.foo();

			p2 o = new p2();
			o.foo();

			//p3 o = new p3();
			//o.foo();

			Console.ReadLine();
		}
		public void foo()
		{
			string s1 = Console.ReadLine();
			string s2 = Console.ReadLine();

			fp = finalPoint(s1);
			bar(s2);
			double d = suc / n;
			Console.WriteLine("{0}", d.ToString("F12"));
		}
		private int fp;
		private double n = 0;
		private double suc = 0;
		private void bar(string s)
		{
			if (s.IndexOf('?') < 0)
			{
				n++;
				if (finalPoint(s) == fp)
					suc++;
				return;
			}

			int ind = s.IndexOf('?');
			string a = s.Substring(0, ind);
			string b = s.Substring(ind + 1);

			bar(a + "+" + b);
			bar(a + "-" + b);
		}
		private int finalPoint(string s)
		{
			int c = 0;
			for (int i = 0; i < s.Length; i++)
			{
				if (s[i] == '+')
					c++;
				else
					c--;
			}
			return c;
		}
	}
}

using System;
using System.IO;

class Algo
{
    int[] f = new int[22];
    public void Run()
    {
        f[0] = 1;
        for (int i = 1; i < 22; i++) f[i] = f[i - 1] * i;
        string s1 = cin.ReadLine();
        string s2 = cin.ReadLine();
        int plus1 = 0, plus2 = 0, q = 0;
        for (int i = 0; i < s1.Length; i++) plus1 += (s1[i] == '+' ? 1 : 0);
        for (int i = 0; i < s2.Length; i++)
        {
            plus2 += (s2[i] == '+' ? 1 : 0);
            q += (s2[i] == '?' ? 1 : 0);
        }
        if (plus1 > plus2 + q)
        {
            cout.WriteLine("0.0");
            return;
        }
        int n = C(q, plus1 - plus2);
        int m = 1 << q;
        cout.WriteLine(1.0 * n / m);
    }

    int C(int n, int m)
    {
        int ans = f[n] / f[m] / f[n - m];
        return ans;
    }

    public StreamReader cin = null;
    public StreamWriter cout = null;
}

class Program
{
    static void Main()
    {
        Algo task = new Algo();
#if DEBUG
        task.cin = new StreamReader("input.txt");
        task.cout = new StreamWriter("output.txt");
#else
        task.cin = new StreamReader(Console.OpenStandardInput());
        task.cout = new StreamWriter(Console.OpenStandardOutput());
#endif
        task.cout.AutoFlush = true;
        task.Run();
    }
}

using System;

namespace R_B_272
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int t = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') t++;
                else t--;
            }
            int[][] a = new int[25][];
            a[0] = new int[1];
            a[0][0] = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s2[i] == '?')
                {
                    a[i + 1] = new int[a[i].Length * 2];
                    int j = 0, z = 0;
                    while (j < a[i].Length)
                    {
                        a[i + 1][z] = a[i][j] - 1;
                        z++;
                        a[i + 1][z] = a[i][j] + 1;
                        z++;
                        j++;
                    }
                }
                else
                {
                    a[i + 1] = new int[a[i].Length];
                    if (s2[i] == '+')
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] + 1;
                        }
                    }
                    else
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] - 1;
                        }
                    }
                }
            }

            double count = 0;
            for (int i = 0; i < a[s2.Length].Length; i++)
            {
                if (a[s2.Length][i] == t) count++;
            }
            double d = count / a[s2.Length].Length;
            Console.WriteLine(d%1000000000);
            Console.ReadLine();
        }
    }
}

using System;

namespace R_B_272
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int t = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') t++;
                else t--;
            }
            int[][] a = new int[25][];
            a[0] = new int[1];
            a[0][0] = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s2[i] == '?')
                {
                    a[i + 1] = new int[a[i].Length * 2];
                    int j = 0, z = 0;
                    while (j < a[i].Length)
                    {
                        a[i + 1][z] = a[i][j] - 1;
                        z++;
                        a[i + 1][z] = a[i][j] + 1;
                        z++;
                        j++;
                    }
                }
                else
                {
                    a[i + 1] = new int[a[i].Length];
                    if (s2[i] == '+')
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] + 1;
                        }
                    }
                    else
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] - 1;
                        }
                    }
                }
            }

            double count = 0;
            for (int i = 0; i < a[s2.Length].Length; i++)
            {
                if (a[s2.Length][i] == t) count++;
            }
            double d = count / a[s2.Length].Length;
            Console.WriteLine("{0:f12}", d);
        }
    }
}

using System;
namespace R_B_272
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int t = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') t++;
                else t--;
            }
            int[][] a = new int[25][];
            a[0] = new int[1];
            a[0][0] = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s2[i] == '?')
                {
                    a[i + 1] = new int[a[i].Length * 2];
                    int j = 0, z = 0;
                    while (j < a[i].Length)
                    {
                        a[i + 1][z] = a[i][j] - 1;
                        z++;
                        a[i + 1][z] = a[i][j] + 1;
                        z++;
                        j++;
                    }
                }
                else
                {
                    a[i + 1] = new int[a[i].Length];
                    if (s2[i] == '+')
                    {
                        for (int j = 0; j < a[i+1].Length; j++)
                        {
                            a[i][j]++;
                        }
                    }
                    else
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i][j]--;
                        }
                    }
                }
            }

            double count = 0;
            for (int i = 0; i < a[s2.Length].Length; i++)
            {
                if (a[s2.Length][i] == t) count++;
            }
            double d = count /a[s2.Length].Length;
            Console.WriteLine("{0:f12}", d);
        }
    }
}

using System;

namespace R_B_272
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine(), s2 = Console.ReadLine();
            int t = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') t++;
                else t--;
            }
            int[][] a = new int[25][];
            a[0] = new int[1];
            a[0][0] = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s2[i] == '?')
                {
                    a[i + 1] = new int[a[i].Length * 2];
                    int j = 0, z = 0;
                    while (j < a[i].Length)
                    {
                        a[i + 1][z] = a[i][j] - 1;
                        z++;
                        a[i + 1][z] = a[i][j] + 1;
                        z++;
                        j++;
                    }
                }
                else
                {
                    a[i + 1] = new int[a[i].Length];
                    if (s2[i] == '+')
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] + 1;
                        }
                    }
                    else
                    {
                        for (int j = 0; j < a[i + 1].Length; j++)
                        {
                            a[i + 1][j] = a[i][j] - 1;
                        }
                    }
                }
            }

            double count = 0;
            for (int i = 0; i < a[s2.Length].Length; i++)
            {
                if (a[s2.Length][i] == t) count++;
            }
            double d = count / a[s2.Length].Length;
            Console.WriteLine("{0:f9}", d);
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dreamoon_and_WiFi
{
    class Program
    {

        static int suc_Event = 0;
        static int end_Pos = 0;
        static void Main(string[] args)
        {
            string str_Correct = Console.ReadLine();
            string str_Unverified = Console.ReadLine();
            int pos = 0;
            int num_unKnown = 0;

            foreach (char map in str_Correct)
            {
                switch (map)
                {
                    case '+':
                        end_Pos++;
                        break;
                    case '-':
                        end_Pos--;
                        break;
                }
            }

            foreach (char map in str_Unverified)
            {
                switch (map)
                {
                    case '+':
                        pos++;
                        break;
                    case '-':
                        pos--;
                        break;
                    case '?':
                        num_unKnown++;
                        break;
                }
            }

            Move(pos, num_unKnown);

            string str_probability = string.Format("{0:0.000000000000}", (double)suc_Event / (double)Math.Pow(2,num_unKnown));
            Console.Write(str_probability);
            Console.Read();

        }

        private static void Move(int CurrentPos,int num_unKnown)
        {
            if (num_unKnown > 0)
            {
                Move(++CurrentPos, --num_unKnown);
                Move(--CurrentPos, --num_unKnown);
            }
            if (CurrentPos == end_Pos)
            {
                suc_Event++;
            }
        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dreamoon_and_WiFi
{
    class Program
    {

        static int suc_Event = 0;
        static int end_Pos = 0;
        static void Main(string[] args)
        {
            string str_Correct = Console.ReadLine();
            string str_Unverified = Console.ReadLine();
            int pos = 0;
            int num_unKnown = 0;

            foreach (char map in str_Correct)
            {
                switch (map)
                {
                    case '+':
                        end_Pos++;
                        break;
                    case '-':
                        end_Pos--;
                        break;
                }
            }

            foreach (char map in str_Unverified)
            {
                switch (map)
                {
                    case '+':
                        pos++;
                        break;
                    case '-':
                        pos--;
                        break;
                    case '?':
                        num_unKnown++;
                        break;
                }
            }

            Move(pos, num_unKnown);

            string str_probability = string.Format("{0:0.000000000000}", (double)suc_Event / (double)Math.Pow(2,num_unKnown)).Replace(',','.');
            Console.Write(str_probability);
            Console.Read();

        }

        private static void Move(int CurrentPos,int num_unKnown)
        {
            if (num_unKnown > 0)
            {
                Move(++CurrentPos, --num_unKnown);
                Move(--CurrentPos, --num_unKnown);
            }
            if (CurrentPos == end_Pos)
            {
                suc_Event++;
            }
        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Dreamoon_and_WiFi
{
    class Program
    {

        static int suc_Event = 0;
        static int end_Pos = 0;
        static void Main(string[] args)
        {
            string str_Correct = Console.ReadLine();
            string str_Unverified = Console.ReadLine();
            int pos = 0;
            int num_unKnown = 0;

            foreach (char map in str_Correct)
            {
                switch (map)
                {
                    case '+':
                        end_Pos++;
                        break;
                    case '-':
                        end_Pos--;
                        break;
                }
            }

            foreach (char map in str_Unverified)
            {
                switch (map)
                {
                    case '+':
                        pos++;
                        break;
                    case '-':
                        pos--;
                        break;
                    case '?':
                        num_unKnown++;
                        break;
                }
            }

            Move(pos, num_unKnown);

            string str_probability = string.Format("{0:0.000000000000}", (double)suc_Event / (double)Math.Pow(2,num_unKnown)).Replace(',','.');
            Console.Write(str_probability);
            Console.Read();

        }

        private static void Move(int CurrentPos,int num_unKnown)
        {
            if (num_unKnown >= 1)
            {
                Move(CurrentPos+1, num_unKnown-1);
                Move(CurrentPos-1, num_unKnown-1);
            }
            if (CurrentPos == end_Pos)
            {
                suc_Event++;
            }
        }
    }

}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Pr1
{
    class Program
    {
        static int gcd(int a,int b)
        {
            while(a!=0&&b!=0)
            {
                if(a>b)
                    a%=b;
                else
                    b%=a;
            }
            if(a==0)
                return b;
            else
                return a;
        }
        static int Factorial(int x)
        {
            return (x == 0) ? 1 : x * Factorial(x - 1);
        }
        static void Main()
        {

            string q=  Console.ReadLine();
            string w=  Console.ReadLine();
            int n=0,m=0,v=0;
            for(int i=0;i<q.Length;i++)
                if(q[i]=='+')
                    n++;
                else
                    n--;
            for(int i=0;i<w.Length;i++)
                if(w[i]=='+')
                    m++;
                else if(w[i]=='-')
                    m--;
                else
                    v++;
            if(Math.Abs(n)%2!=Math.Abs(m)%2||Math.Abs(n-m)>v)
                Console.Write(0);
            else
                Console.Write(((double)(Factorial(v)/Factorial(v-(v-Math.Abs(n-m))/2)/Factorial((v-Math.Abs(n-m))/2))/Math.Pow(2,v)).ToString().Replace(',','.'));

        }
    }
}

using System;
using System.Collections.Generic;
//using System.Linq;
using System.Text;
//using System.Threading.Tasks;
using System.Globalization;

namespace _272_b
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int d1 = 0;
            int d2 = 0;
            var d2list = new List<int>();

            foreach(char sym in s1)
            {
                if (sym == '+')
                    d1 += 1;
                else d1 -= 1;
            }

            int k = 0;
            foreach (char sym in s2)
            {
                if (sym == '+')
                    d2 += 1;
                else
                    if (sym == '-')
                        d2 -= 1;
                    else k++;
            }

            if(k != 0)
            {
                for (int i = k; i >= 0; i -= 2)
                {
                    d2list.Add(d2 + i);
                    d2list.Add(d2 - i);
                }
                var t = d2list.FindAll(x => x == d1);

                if (t.Count != 0)
                {
                    double res = (double)t.Count / (double)d2list.Count;
                    Console.Write(res.ToString((CultureInfo.InvariantCulture)));
                }
                else Console.Write(0.0);
            }
            else
            {
                if (d1 != d2)
                    Console.Write(0.0);
                else Console.Write(1.0);
            }
        }
    }
}

#region Using Statements
using GenericArithmetic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

#endregion
namespace csConsoleforStudy
{
 using System.Collections.Generic;
 using System.Globalization;

 class Program
 {
  static readonly Encoding TargetEcoding = Encoding.Unicode;
  static void Main(string[] args)
  {
   OpenStream();
   Solver s = new Solver();
   s.Solve();
   CloseStream();
  }

  static void OpenStream()
  {
  }

  static void CloseStream()
  {
  }

  static void CheckMemory()
  {
  }
 }

 class Solver
 {
  public static readonly Encoding TargetEncoding = Encoding.Unicode;
  const int SIZE = 5005;
  private const double AbsoluteError = 1e-10;
  private const double RelativeError = 1e-8;
  static int mod = 1000000007;
  public void Solve()
  {
   string s1 = rs();
   string s2 = rs();
   int target = 0;
   int pos = 0;
   int que = 0;
   double result = 0f;
   for (int i = 0; i < s1.Length; i++)
   {
    if (s1[i] == '+')
     target++;
    else
     target--;
   }

   for (int i = 0; i < s2.Length; i++)
   {
    if (s2[i] == '+')
     pos++;
    else if (s2[i] == '-')
     pos--;
    else
    {
     que++;
    }
   }

   if (que % 2 == 0)
   {
    if ((target - pos) % 2 == 0)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus = d;
     int minus = 0;
     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }
   else
   {
    if ((target - pos) % 2 == 1)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus = d;
     int minus = 0;
     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }

   string ans = result.ToString("F10", CultureInfo.InvariantCulture);
   Console.Write(ans);
  }

#region SolverUtils
  private static List<int> factorial = new List<int>(new int[]{1});
  private static int NextInt()
  {
   int c;
   int res = 0;
   do
   {
    c = Console.Read();
    if (c == -1)
     return res;
   }
   while (c < '0' || c > '9');
   res = c - '0';
   while (true)
   {
    c = Console.Read();
    if (c < '0' || c > '9')
     return res;
    res *= 10;
    res += c - '0';
   }
  }

  static string rs()
  {
   return Console.ReadLine();
  }

  static int ri()
  {
   return int.Parse(Console.ReadLine());
  }

  static uint rui()
  {
   return uint.Parse(Console.ReadLine());
  }

  static long rl()
  {
   return long.Parse(Console.ReadLine());
  }

  static ulong rul()
  {
   return ulong.Parse(Console.ReadLine());
  }

  static double rd()
  {
   return double.Parse(Console.ReadLine());
  }

  static string[] rsa()
  {
   return Console.ReadLine().Split(' ');
  }

  static int[] ria()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));
  }

  static uint[] ruia()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));
  }

  static long[] rla()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));
  }

  static ulong[] rula()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));
  }

  static double[] rda()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));
  }

  static void ReadLineAndAssign(string type, params object[] p)
  {
   dynamic input;
   if (type.StartsWith("i"))
    input = ria();
   else if (type.StartsWith("l"))
    input = rla();
   else if (type.StartsWith("d"))
    input = rda();
   else
    throw new ArgumentException("no match " + type.ToString());
   for (int i = 0; i < p.Length; i++)
   {
    p[i] = input[i];
   }
  }

  static void SwapIfGreater<T>(ref T lhs, ref T rhs)where T : IComparable<T>
  {
   T temp;
   if (lhs.CompareTo(rhs) > 0)
   {
    temp = lhs;
    lhs = rhs;
    rhs = temp;
   }
  }

  static bool DoubleEqual(double a, double b)
  {
   double diff = Math.Abs(a - b);
   if (diff < AbsoluteError)
    return true;
   return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));
  }

  static dynamic abs(dynamic num)
  {
   return Math.Abs(num);
  }

  static dynamic max(dynamic a, dynamic b)
  {
   return Math.Max(a, b);
  }

  static void For(int start, int end, Action method)
  {
   for (int i = start; i < end; i++)
   {
    method.Invoke();
   }
  }

  static void For(int start, int end, Action<int> method, int i)
  {
   for (i = start; i < end; i++)
   {
    method.DynamicInvoke(i);
   }
  }

  static int C(int n, int k)
  {
   return P(n, k) / Factorial(k);
  }

  static int P(int n, int r)
  {
   return Factorial(n) / Factorial(n - r);
  }

  static int Factorial(int n)
  {
   if (factorial.Count <= n)
    factorial.Add(Factorial(n - 1) * n);
   return factorial[n];
  }

  static int powmod(int a, int b)
  {
   if (b == 0)
    return 1;
   if (b == 1)
    return a;
   int i = powmod(a, b / 2);
   i *= i;
   i %= mod;
   if (b % 2 == 0)
    return i;
   else
    return ((i * a) % mod);
  }
#endregion
 }
#region SolverUtils
#endregion
#region Data Structure
#endregion
#region Algorithm
#endregion
#region Library Method/Fields
#region Members for Internal Support
#endregion Members for Internal Support
#region Public Properties
#endregion Public Properties
#region Public Instance Methods
#endregion Public Instance Methods
#region Constructors
#endregion Constructors
#region Public Static Methods
#endregion Public Static Methods
#region Operator Overloads
#endregion Operator Overloads
#region explicit conversions from BigRational
#endregion explicit conversions from BigRational
#region implicit conversions to BigRational
#endregion implicit conversions to BigRational
#region serialization
#endregion serialization
#region instance helper methods
#endregion instance helper methods
#region static helper methods
#endregion static helper methods
#region Exceptions
#endregion
#endregion
}

#region Libraries
namespace GenericArithmetic
{
 public class Vector<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public T X
  {
   get;
   set;
  }

  public T Y
  {
   get;
   set;
  }

  public Vector(T x, T y)
  {
   X = x;
   Y = y;
  }

  public override bool Equals(object obj)
  {
   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Vector<T> a, Vector<T> b)
  {
   return EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y);
  }

  public static bool operator !=(Vector<T> a, Vector<T> b)
  {
   return !(EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y));
  }

  public static Vector<T> operator !(Vector<T> a)
  {
   return new Vector<T>(Calculator.Difference(new Number<T>(default (T)), a.X), Calculator.Difference(new Number<T>(default (T)), a.Y));
  }

  public static Vector<T> operator +(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));
  }

  public static Vector<T> operator -(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));
  }
 }

 public class Matrix<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public int W
  {
   get;
   set;
  }

  public int H
  {
   get;
   set;
  }

  public int rows
  {
   get
   {
    return H;
   }

   set
   {
    H = value;
   }
  }

  public int cols
  {
   get
   {
    return W;
   }

   set
   {
    W = value;
   }
  }

  public T[, ] Map
  {
   get;
   set;
  }

  public T this[int x, int y]
  {
   get
   {
    return Map[x, y];
   }

   set
   {
    Map[x, y] = value;
   }
  }

  public Matrix(T[, ] map)
  {
   Map = map;
   W = map.GetLength(0);
   H = map.GetLength(1);
  }

  public Matrix(int w, int h, T defaultValue = default (T))
  {
   W = w;
   H = h;
   Map = new T[W, H];
  }

  public override bool Equals(object obj)
  {
   if (obj is Matrix<T>)
   {
    return this == (Matrix<T>)obj;
   }

   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return ret;
  }

  public static bool operator !=(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return !ret;
  }

  public static Matrix<T> operator +(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator -(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator *(Matrix<T> a, Matrix<T> b)
  {
   if (a.cols != b.rows)
    throw new FormatException("Cannot multiply : a.W = " + a.W.ToString() + " with b.H = " + b.H.ToString());
   else
   {
    Matrix<T> R = new Matrix<T>(a.rows, b.cols);
    for (int i = 0; i < R.rows; i++)
     for (int j = 0; j < R.cols; j++)
      for (int k = 0; k < a.cols; k++)
      {
       R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));
      }

    return R;
   }
  }
 }

 public static class Calculator
 {
  public static T Sum<T>(T a, T b)
  {
   return Number<T>.Sum(a, b);
  }
 }

 public interface ICalculator<T>
 {
  T Sum(T a, T b);
  T Difference(T a, T b);
  int Compare(T a, T b);
  T Multiply(T a, T b);
  T Divide(T a, T b);
  T Divide(T a, int b);
 }

 struct Int32Calculator : ICalculator<Int32>
 {
  public Int32 Sum(Int32 a, Int32 b)
  {
   return a + b;
  }

  public Int32 Difference(Int32 a, Int32 b)
  {
   return a - b;
  }

  public int Compare(Int32 a, Int32 b)
  {
   return Difference(a, b);
  }

  public int Multiply(Int32 a, Int32 b)
  {
   return a * b;
  }

  public int Divide(Int32 a, Int32 b)
  {
   return a / b;
  }
 }

 struct Int64Calculator : ICalculator<Int64>
 {
  public Int64 Sum(Int64 a, Int64 b)
  {
   return a + b;
  }

  public Int64 Difference(Int64 a, Int64 b)
  {
   return a - b;
  }

  public int Compare(Int64 a, Int64 b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Int64 Multiply(Int64 a, Int64 b)
  {
   return a * b;
  }

  public Int64 Divide(Int64 a, Int64 b)
  {
   return a / b;
  }

  public Int64 Divide(Int64 a, int b)
  {
   return a / b;
  }
 }

 struct SingleCalculator : ICalculator<Single>
 {
  public Single Sum(Single a, Single b)
  {
   return a + b;
  }

  public Single Difference(Single a, Single b)
  {
   return a - b;
  }

  public int Compare(Single a, Single b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Single Multiply(Single a, Single b)
  {
   return a * b;
  }

  public Single Divide(Single a, Single b)
  {
   return a / b;
  }

  public Single Divide(Single a, int b)
  {
   return a / b;
  }
 }

 struct DoubleCalculator : ICalculator<double>
 {
  public double Sum(double a, double b)
  {
   return a + b;
  }

  public double Difference(double a, double b)
  {
   return a - b;
  }

  public int Compare(double a, double b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public double Multiply(double a, double b)
  {
   return a * b;
  }

  public Double Divide(Double a, Double b)
  {
   return a / b;
  }

  public Double Divide(Double a, int b)
  {
   return a / b;
  }
 }

 struct StringCalculator : ICalculator<string>
 {
  public string Sum(string a, string b)
  {
   return a + b;
  }

  public string Difference(string a, string b)
  {
   if (b.Length < a.Length)
   {
    return a.Substring(0, b.Length);
   }
   else
   {
    return "";
   }
  }

  public int Compare(string a, string b)
  {
   return a.CompareTo(b);
  }

  public string Multiply(string a, string b)
  {
   if (a.Length == 1 && b.Length == 1)
   {
    return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + "";
   }

   int bigLength = Math.Max(a.Length, b.Length);
   while (a.Length < bigLength)
   {
    a = " " + a;
   }

   while (b.Length < bigLength)
   {
    b = " " + b;
   }

   string result = "";
   for (int i = 0; i < bigLength; i++)
   {
    Number<string> numA = a[i] + "";
    Number<string> numB = b[i] + "";
    result += numA * numB;
   }

   return result;
  }

  public String Divide(String a, String b)
  {
   return String.Format("{0} / {1}", a, b);
  }

  public String Divide(String a, int b)
  {
   return String.Format("{0} / {1}", a, b);
  }
 }

 public class Number<T>
 {
  private T value;
  public Number(T value)
  {
   this.value = value;
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

  public static Type GetCalculatorType()
  {
   Type tType = typeof (T);
   Type calculatorType = null;
   if (tType == typeof (Int32))
   {
    calculatorType = typeof (Int32Calculator);
   }
   else if (tType == typeof (Int64))
   {
    calculatorType = typeof (Int64Calculator);
   }
   else if (tType == typeof (Double))
   {
    calculatorType = typeof (DoubleCalculator);
   }
   else if (tType == typeof (string))
   {
    calculatorType = typeof (StringCalculator);
   }
   else
   {
    throw new InvalidCastException(String.Format("Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator<T> and cannot be used in generic arithmetic using type Number<T>", tType.Name));
   }

   return calculatorType;
  }

  private static ICalculator<T> fCalculator = null;
  public static ICalculator<T> Calculator
  {
   get
   {
    if (fCalculator == null)
    {
     MakeCalculator();
    }

    return fCalculator;
   }
  }

  public static void MakeCalculator()
  {
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

#region operation methods
  public static T Sum(T a, T b)
  {
   return Calculator.Sum(a, b);
  }

  public static T Difference(T a, T b)
  {
   return Calculator.Difference(a, b);
  }

  public static int Compare(T a, T b)
  {
   return Calculator.Compare(a, b);
  }

  public static T Multiply(T a, T b)
  {
   return Calculator.Multiply(a, b);
  }

  public static T Divide(T a, T b)
  {
   return Calculator.Divide(a, b);
  }

  public static T Divide(T a, int b)
  {
   return Calculator.Divide(a, b);
  }

#endregion
#region Operators
  public static implicit operator Number<T>(T a)
  {
   return new Number<T>(a);
  }

  public static implicit operator T(Number<T> a)
  {
   return a.value;
  }

  public static Number<T> operator +(Number<T> a, Number<T> b)
  {
   return Calculator.Sum(a.value, b.value);
  }

  public static Number<T> operator -(Number<T> a, Number<T> b)
  {
   return Calculator.Difference(a, b);
  }

  public static bool operator>(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) > 0;
  }

  public static bool operator <(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) < 0;
  }

  public static Number<T> operator *(Number<T> a, Number<T> b)
  {
   return Calculator.Multiply(a, b);
  }

  public static Number<T> operator /(Number<T> a, Number<T> b)
  {
   return Calculator.Divide(a, b);
  }

  public static Number<T> operator /(Number<T> a, int b)
  {
   return Calculator.Divide(a, b);
  }
#endregion
 }
}
#region DataStructures
#region IComparable implementation
#endregion
#region Model
#endregion
#region Constructors
#endregion
#region Internal
#region IEqualityComparer implementation
#endregion
#endregion
#region IGraph implementation
#endregion
#region Clique invariants
#endregion
#region Clique methods
#endregion
#region IEquatable implementation
#endregion
#endregion
#region Algorithms
#endregion
#endregion

#region Using Statements
using GenericArithmetic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

#endregion
namespace csConsoleforStudy
{
 using System.Collections.Generic;
 using System.Globalization;

 class Program
 {
  static readonly Encoding TargetEcoding = Encoding.Unicode;
  static void Main(string[] args)
  {
   OpenStream();
   Solver s = new Solver();
   s.Solve();
   CloseStream();
  }

  static void OpenStream()
  {
  }

  static void CloseStream()
  {
  }

  static void CheckMemory()
  {
  }
 }

 class Solver
 {
  public static readonly Encoding TargetEncoding = Encoding.Unicode;
  const int SIZE = 5005;
  private const double AbsoluteError = 1e-10;
  private const double RelativeError = 1e-8;
  static int mod = 1000000007;
  public void Solve()
  {
   int k = -5 % 2;
   string s1 = rs();
   string s2 = rs();
   int target = 0;
   int pos = 0;
   int que = 0;
   double result = 0f;
   for (int i = 0; i < s1.Length; i++)
   {
    if (s1[i] == '+')
     target++;
    else
     target--;
   }

   for (int i = 0; i < s2.Length; i++)
   {
    if (s2[i] == '+')
     pos++;
    else if (s2[i] == '-')
     pos--;
    else
    {
     que++;
    }
   }

   if (que % 2 == 0)
   {
    if ((target - pos) % 2 == 0)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus, minus;
     if (target - pos > 0)
     {
      plus = d;
      minus = 0;
     }
     else
     {
      plus = 0;
      minus = d;
     }

     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }
   else
   {
    if ((target - pos).ToString().Last() == '1')
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus, minus;
     if (target - pos > 0)
     {
      plus = d;
      minus = 0;
     }
     else
     {
      plus = 0;
      minus = d;
     }

     for (int i = 0;; i++)
     {
      if (plus + minus >= que)
       break;
      plus++;
      minus++;
     }

     if (plus + minus == que)
      result = (double)C(que, plus) / Math.Pow(2, que);
     else
      result = 0f;
    }
    else
     result = 0f;
   }

   string ans = result.ToString("F10", CultureInfo.InvariantCulture);
   Console.Write(ans);
  }

#region SolverUtils
  private static List<int> factorial = new List<int>(new int[]{1});
  private static int NextInt()
  {
   int c;
   int res = 0;
   do
   {
    c = Console.Read();
    if (c == -1)
     return res;
   }
   while (c < '0' || c > '9');
   res = c - '0';
   while (true)
   {
    c = Console.Read();
    if (c < '0' || c > '9')
     return res;
    res *= 10;
    res += c - '0';
   }
  }

  static string rs()
  {
   return Console.ReadLine();
  }

  static int ri()
  {
   return int.Parse(Console.ReadLine());
  }

  static uint rui()
  {
   return uint.Parse(Console.ReadLine());
  }

  static long rl()
  {
   return long.Parse(Console.ReadLine());
  }

  static ulong rul()
  {
   return ulong.Parse(Console.ReadLine());
  }

  static double rd()
  {
   return double.Parse(Console.ReadLine());
  }

  static string[] rsa()
  {
   return Console.ReadLine().Split(' ');
  }

  static int[] ria()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));
  }

  static uint[] ruia()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));
  }

  static long[] rla()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));
  }

  static ulong[] rula()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));
  }

  static double[] rda()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));
  }

  static void ReadLineAndAssign(string type, params object[] p)
  {
   dynamic input;
   if (type.StartsWith("i"))
    input = ria();
   else if (type.StartsWith("l"))
    input = rla();
   else if (type.StartsWith("d"))
    input = rda();
   else
    throw new ArgumentException("no match " + type.ToString());
   for (int i = 0; i < p.Length; i++)
   {
    p[i] = input[i];
   }
  }

  static void SwapIfGreater<T>(ref T lhs, ref T rhs)where T : IComparable<T>
  {
   T temp;
   if (lhs.CompareTo(rhs) > 0)
   {
    temp = lhs;
    lhs = rhs;
    rhs = temp;
   }
  }

  static bool DoubleEqual(double a, double b)
  {
   double diff = Math.Abs(a - b);
   if (diff < AbsoluteError)
    return true;
   return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));
  }

  static dynamic abs(dynamic num)
  {
   return Math.Abs(num);
  }

  static dynamic max(dynamic a, dynamic b)
  {
   return Math.Max(a, b);
  }

  static void For(int start, int end, Action method)
  {
   for (int i = start; i < end; i++)
   {
    method.Invoke();
   }
  }

  static void For(int start, int end, Action<int> method, int i)
  {
   for (i = start; i < end; i++)
   {
    method.DynamicInvoke(i);
   }
  }

  static int C(int n, int k)
  {
   return P(n, k) / Factorial(k);
  }

  static int P(int n, int r)
  {
   return Factorial(n) / Factorial(n - r);
  }

  static int Factorial(int n)
  {
   if (factorial.Count <= n)
    factorial.Add(Factorial(n - 1) * n);
   return factorial[n];
  }

  static int powmod(int a, int b)
  {
   if (b == 0)
    return 1;
   if (b == 1)
    return a;
   int i = powmod(a, b / 2);
   i *= i;
   i %= mod;
   if (b % 2 == 0)
    return i;
   else
    return ((i * a) % mod);
  }
#endregion
 }
#region SolverUtils
#endregion
#region Data Structure
#endregion
#region Algorithm
#endregion
#region Library Method/Fields
#region Members for Internal Support
#endregion Members for Internal Support
#region Public Properties
#endregion Public Properties
#region Public Instance Methods
#endregion Public Instance Methods
#region Constructors
#endregion Constructors
#region Public Static Methods
#endregion Public Static Methods
#region Operator Overloads
#endregion Operator Overloads
#region explicit conversions from BigRational
#endregion explicit conversions from BigRational
#region implicit conversions to BigRational
#endregion implicit conversions to BigRational
#region serialization
#endregion serialization
#region instance helper methods
#endregion instance helper methods
#region static helper methods
#endregion static helper methods
#region Exceptions
#endregion
#endregion
}

#region Libraries
namespace GenericArithmetic
{
 public class Vector<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public T X
  {
   get;
   set;
  }

  public T Y
  {
   get;
   set;
  }

  public Vector(T x, T y)
  {
   X = x;
   Y = y;
  }

  public override bool Equals(object obj)
  {
   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Vector<T> a, Vector<T> b)
  {
   return EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y);
  }

  public static bool operator !=(Vector<T> a, Vector<T> b)
  {
   return !(EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y));
  }

  public static Vector<T> operator !(Vector<T> a)
  {
   return new Vector<T>(Calculator.Difference(new Number<T>(default (T)), a.X), Calculator.Difference(new Number<T>(default (T)), a.Y));
  }

  public static Vector<T> operator +(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));
  }

  public static Vector<T> operator -(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));
  }
 }

 public class Matrix<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public int W
  {
   get;
   set;
  }

  public int H
  {
   get;
   set;
  }

  public int rows
  {
   get
   {
    return H;
   }

   set
   {
    H = value;
   }
  }

  public int cols
  {
   get
   {
    return W;
   }

   set
   {
    W = value;
   }
  }

  public T[, ] Map
  {
   get;
   set;
  }

  public T this[int x, int y]
  {
   get
   {
    return Map[x, y];
   }

   set
   {
    Map[x, y] = value;
   }
  }

  public Matrix(T[, ] map)
  {
   Map = map;
   W = map.GetLength(0);
   H = map.GetLength(1);
  }

  public Matrix(int w, int h, T defaultValue = default (T))
  {
   W = w;
   H = h;
   Map = new T[W, H];
  }

  public override bool Equals(object obj)
  {
   if (obj is Matrix<T>)
   {
    return this == (Matrix<T>)obj;
   }

   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return ret;
  }

  public static bool operator !=(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return !ret;
  }

  public static Matrix<T> operator +(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator -(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator *(Matrix<T> a, Matrix<T> b)
  {
   if (a.cols != b.rows)
    throw new FormatException("Cannot multiply : a.W = " + a.W.ToString() + " with b.H = " + b.H.ToString());
   else
   {
    Matrix<T> R = new Matrix<T>(a.rows, b.cols);
    for (int i = 0; i < R.rows; i++)
     for (int j = 0; j < R.cols; j++)
      for (int k = 0; k < a.cols; k++)
      {
       R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));
      }

    return R;
   }
  }
 }

 public static class Calculator
 {
  public static T Sum<T>(T a, T b)
  {
   return Number<T>.Sum(a, b);
  }
 }

 public interface ICalculator<T>
 {
  T Sum(T a, T b);
  T Difference(T a, T b);
  int Compare(T a, T b);
  T Multiply(T a, T b);
  T Divide(T a, T b);
  T Divide(T a, int b);
 }

 struct Int32Calculator : ICalculator<Int32>
 {
  public Int32 Sum(Int32 a, Int32 b)
  {
   return a + b;
  }

  public Int32 Difference(Int32 a, Int32 b)
  {
   return a - b;
  }

  public int Compare(Int32 a, Int32 b)
  {
   return Difference(a, b);
  }

  public int Multiply(Int32 a, Int32 b)
  {
   return a * b;
  }

  public int Divide(Int32 a, Int32 b)
  {
   return a / b;
  }
 }

 struct Int64Calculator : ICalculator<Int64>
 {
  public Int64 Sum(Int64 a, Int64 b)
  {
   return a + b;
  }

  public Int64 Difference(Int64 a, Int64 b)
  {
   return a - b;
  }

  public int Compare(Int64 a, Int64 b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Int64 Multiply(Int64 a, Int64 b)
  {
   return a * b;
  }

  public Int64 Divide(Int64 a, Int64 b)
  {
   return a / b;
  }

  public Int64 Divide(Int64 a, int b)
  {
   return a / b;
  }
 }

 struct SingleCalculator : ICalculator<Single>
 {
  public Single Sum(Single a, Single b)
  {
   return a + b;
  }

  public Single Difference(Single a, Single b)
  {
   return a - b;
  }

  public int Compare(Single a, Single b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Single Multiply(Single a, Single b)
  {
   return a * b;
  }

  public Single Divide(Single a, Single b)
  {
   return a / b;
  }

  public Single Divide(Single a, int b)
  {
   return a / b;
  }
 }

 struct DoubleCalculator : ICalculator<double>
 {
  public double Sum(double a, double b)
  {
   return a + b;
  }

  public double Difference(double a, double b)
  {
   return a - b;
  }

  public int Compare(double a, double b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public double Multiply(double a, double b)
  {
   return a * b;
  }

  public Double Divide(Double a, Double b)
  {
   return a / b;
  }

  public Double Divide(Double a, int b)
  {
   return a / b;
  }
 }

 struct StringCalculator : ICalculator<string>
 {
  public string Sum(string a, string b)
  {
   return a + b;
  }

  public string Difference(string a, string b)
  {
   if (b.Length < a.Length)
   {
    return a.Substring(0, b.Length);
   }
   else
   {
    return "";
   }
  }

  public int Compare(string a, string b)
  {
   return a.CompareTo(b);
  }

  public string Multiply(string a, string b)
  {
   if (a.Length == 1 && b.Length == 1)
   {
    return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + "";
   }

   int bigLength = Math.Max(a.Length, b.Length);
   while (a.Length < bigLength)
   {
    a = " " + a;
   }

   while (b.Length < bigLength)
   {
    b = " " + b;
   }

   string result = "";
   for (int i = 0; i < bigLength; i++)
   {
    Number<string> numA = a[i] + "";
    Number<string> numB = b[i] + "";
    result += numA * numB;
   }

   return result;
  }

  public String Divide(String a, String b)
  {
   return String.Format("{0} / {1}", a, b);
  }

  public String Divide(String a, int b)
  {
   return String.Format("{0} / {1}", a, b);
  }
 }

 public class Number<T>
 {
  private T value;
  public Number(T value)
  {
   this.value = value;
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

  public static Type GetCalculatorType()
  {
   Type tType = typeof (T);
   Type calculatorType = null;
   if (tType == typeof (Int32))
   {
    calculatorType = typeof (Int32Calculator);
   }
   else if (tType == typeof (Int64))
   {
    calculatorType = typeof (Int64Calculator);
   }
   else if (tType == typeof (Double))
   {
    calculatorType = typeof (DoubleCalculator);
   }
   else if (tType == typeof (string))
   {
    calculatorType = typeof (StringCalculator);
   }
   else
   {
    throw new InvalidCastException(String.Format("Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator<T> and cannot be used in generic arithmetic using type Number<T>", tType.Name));
   }

   return calculatorType;
  }

  private static ICalculator<T> fCalculator = null;
  public static ICalculator<T> Calculator
  {
   get
   {
    if (fCalculator == null)
    {
     MakeCalculator();
    }

    return fCalculator;
   }
  }

  public static void MakeCalculator()
  {
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

#region operation methods
  public static T Sum(T a, T b)
  {
   return Calculator.Sum(a, b);
  }

  public static T Difference(T a, T b)
  {
   return Calculator.Difference(a, b);
  }

  public static int Compare(T a, T b)
  {
   return Calculator.Compare(a, b);
  }

  public static T Multiply(T a, T b)
  {
   return Calculator.Multiply(a, b);
  }

  public static T Divide(T a, T b)
  {
   return Calculator.Divide(a, b);
  }

  public static T Divide(T a, int b)
  {
   return Calculator.Divide(a, b);
  }

#endregion
#region Operators
  public static implicit operator Number<T>(T a)
  {
   return new Number<T>(a);
  }

  public static implicit operator T(Number<T> a)
  {
   return a.value;
  }

  public static Number<T> operator +(Number<T> a, Number<T> b)
  {
   return Calculator.Sum(a.value, b.value);
  }

  public static Number<T> operator -(Number<T> a, Number<T> b)
  {
   return Calculator.Difference(a, b);
  }

  public static bool operator>(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) > 0;
  }

  public static bool operator <(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) < 0;
  }

  public static Number<T> operator *(Number<T> a, Number<T> b)
  {
   return Calculator.Multiply(a, b);
  }

  public static Number<T> operator /(Number<T> a, Number<T> b)
  {
   return Calculator.Divide(a, b);
  }

  public static Number<T> operator /(Number<T> a, int b)
  {
   return Calculator.Divide(a, b);
  }
#endregion
 }
}
#region DataStructures
#region IComparable implementation
#endregion
#region Model
#endregion
#region Constructors
#endregion
#region Internal
#region IEqualityComparer implementation
#endregion
#endregion
#region IGraph implementation
#endregion
#region Clique invariants
#endregion
#region Clique methods
#endregion
#region IEquatable implementation
#endregion
#endregion
#region Algorithms
#endregion
#endregion

#region Using Statements
using GenericArithmetic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

#endregion
namespace csConsoleforStudy
{
 using System.Collections.Generic;
 using System.Globalization;

 class Program
 {
  static readonly Encoding TargetEcoding = Encoding.Unicode;
  static void Main(string[] args)
  {
   OpenStream();
   Solver s = new Solver();
   s.Solve();
   CloseStream();
  }

  static void OpenStream()
  {
  }

  static void CloseStream()
  {
  }

  static void CheckMemory()
  {
  }
 }

 class Solver
 {
  public static readonly Encoding TargetEncoding = Encoding.Unicode;
  const int SIZE = 5005;
  private const double AbsoluteError = 1e-10;
  private const double RelativeError = 1e-8;
  static int mod = 1000000007;
  public void Solve()
  {
   string s1 = rs();
   string s2 = rs();
   int target = 0;
   int pos = 0;
   int que = 0;
   double result = 0f;
   for (int i = 0; i < s1.Length; i++)
   {
    if (s1[i] == '+')
     target++;
    else
     target--;
   }

   for (int i = 0; i < s2.Length; i++)
   {
    if (s2[i] == '+')
     pos++;
    else if (s2[i] == '-')
     pos--;
    else
    {
     que++;
    }
   }

   if (que % 2 == 0)
   {
    if ((target - pos) % 2 == 0)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus = d;
     int minus = 0;
     for (int i = 0;; i++)
     {
      if (plus + minus == que)
       break;
      plus++;
      minus++;
     }

     result = (double)C(que, plus) / Math.Pow(2, que);
    }
    else
     result = 0f;
   }
   else
   {
    if ((target - pos) % 2 == 1)
    {
     int d = target - pos;
     d = Math.Abs(d);
     int plus = d;
     int minus = 0;
     for (int i = 0;; i++)
     {
      if (plus + minus == que)
       break;
      plus++;
      minus++;
     }

     result = (double)C(que, plus) / Math.Pow(2, que);
    }
    else
     result = 0f;
   }

   string ans = result.ToString("F10", CultureInfo.InvariantCulture);
   Console.Write(ans);
  }

#region SolverUtils
  private static List<int> factorial = new List<int>(new int[]{1});
  private static int NextInt()
  {
   int c;
   int res = 0;
   do
   {
    c = Console.Read();
    if (c == -1)
     return res;
   }
   while (c < '0' || c > '9');
   res = c - '0';
   while (true)
   {
    c = Console.Read();
    if (c < '0' || c > '9')
     return res;
    res *= 10;
    res += c - '0';
   }
  }

  static string rs()
  {
   return Console.ReadLine();
  }

  static int ri()
  {
   return int.Parse(Console.ReadLine());
  }

  static uint rui()
  {
   return uint.Parse(Console.ReadLine());
  }

  static long rl()
  {
   return long.Parse(Console.ReadLine());
  }

  static ulong rul()
  {
   return ulong.Parse(Console.ReadLine());
  }

  static double rd()
  {
   return double.Parse(Console.ReadLine());
  }

  static string[] rsa()
  {
   return Console.ReadLine().Split(' ');
  }

  static int[] ria()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => int.Parse(e));
  }

  static uint[] ruia()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => uint.Parse(e));
  }

  static long[] rla()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => long.Parse(e));
  }

  static ulong[] rula()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => ulong.Parse(e));
  }

  static double[] rda()
  {
   return Array.ConvertAll(Console.ReadLine().Split(' '), e => double.Parse(e));
  }

  static void ReadLineAndAssign(string type, params object[] p)
  {
   dynamic input;
   if (type.StartsWith("i"))
    input = ria();
   else if (type.StartsWith("l"))
    input = rla();
   else if (type.StartsWith("d"))
    input = rda();
   else
    throw new ArgumentException("no match " + type.ToString());
   for (int i = 0; i < p.Length; i++)
   {
    p[i] = input[i];
   }
  }

  static void SwapIfGreater<T>(ref T lhs, ref T rhs)where T : IComparable<T>
  {
   T temp;
   if (lhs.CompareTo(rhs) > 0)
   {
    temp = lhs;
    lhs = rhs;
    rhs = temp;
   }
  }

  static bool DoubleEqual(double a, double b)
  {
   double diff = Math.Abs(a - b);
   if (diff < AbsoluteError)
    return true;
   return diff <= RelativeError * Math.Max(Math.Abs(a), Math.Abs(b));
  }

  static dynamic abs(dynamic num)
  {
   return Math.Abs(num);
  }

  static dynamic max(dynamic a, dynamic b)
  {
   return Math.Max(a, b);
  }

  static void For(int start, int end, Action method)
  {
   for (int i = start; i < end; i++)
   {
    method.Invoke();
   }
  }

  static void For(int start, int end, Action<int> method, int i)
  {
   for (i = start; i < end; i++)
   {
    method.DynamicInvoke(i);
   }
  }

  static int C(int n, int k)
  {
   return P(n, k) / Factorial(n);
  }

  static int P(int n, int r)
  {
   return Factorial(n) / Factorial(n - r);
  }

  static int Factorial(int n)
  {
   if (factorial.Count <= n)
    factorial.Add(Factorial(n - 1) * n);
   return factorial[n];
  }

  static int powmod(int a, int b)
  {
   if (b == 0)
    return 1;
   if (b == 1)
    return a;
   int i = powmod(a, b / 2);
   i *= i;
   i %= mod;
   if (b % 2 == 0)
    return i;
   else
    return ((i * a) % mod);
  }
#endregion
 }
#region SolverUtils
#endregion
#region Data Structure
#endregion
#region Algorithm
#endregion
#region Library Method/Fields
#region Members for Internal Support
#endregion Members for Internal Support
#region Public Properties
#endregion Public Properties
#region Public Instance Methods
#endregion Public Instance Methods
#region Constructors
#endregion Constructors
#region Public Static Methods
#endregion Public Static Methods
#region Operator Overloads
#endregion Operator Overloads
#region explicit conversions from BigRational
#endregion explicit conversions from BigRational
#region implicit conversions to BigRational
#endregion implicit conversions to BigRational
#region serialization
#endregion serialization
#region instance helper methods
#endregion instance helper methods
#region static helper methods
#endregion static helper methods
#region Exceptions
#endregion
#endregion
}

#region Libraries
namespace GenericArithmetic
{
 public class Vector<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public T X
  {
   get;
   set;
  }

  public T Y
  {
   get;
   set;
  }

  public Vector(T x, T y)
  {
   X = x;
   Y = y;
  }

  public override bool Equals(object obj)
  {
   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Vector<T> a, Vector<T> b)
  {
   return EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y);
  }

  public static bool operator !=(Vector<T> a, Vector<T> b)
  {
   return !(EqualityComparer<T>.Default.Equals(a.X, b.X) && EqualityComparer<T>.Default.Equals(a.Y, b.Y));
  }

  public static Vector<T> operator !(Vector<T> a)
  {
   return new Vector<T>(Calculator.Difference(new Number<T>(default (T)), a.X), Calculator.Difference(new Number<T>(default (T)), a.Y));
  }

  public static Vector<T> operator +(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Sum(a.X, b.X), Calculator.Sum(a.Y, b.Y));
  }

  public static Vector<T> operator -(Vector<T> a, Vector<T> b)
  {
   return new Vector<T>(Calculator.Difference(a.X, b.X), Calculator.Difference(a.Y, b.Y));
  }
 }

 public class Matrix<T>
 {
  public static readonly ICalculator<T> Calculator = Number<T>.Calculator;
  public int W
  {
   get;
   set;
  }

  public int H
  {
   get;
   set;
  }

  public int rows
  {
   get
   {
    return H;
   }

   set
   {
    H = value;
   }
  }

  public int cols
  {
   get
   {
    return W;
   }

   set
   {
    W = value;
   }
  }

  public T[, ] Map
  {
   get;
   set;
  }

  public T this[int x, int y]
  {
   get
   {
    return Map[x, y];
   }

   set
   {
    Map[x, y] = value;
   }
  }

  public Matrix(T[, ] map)
  {
   Map = map;
   W = map.GetLength(0);
   H = map.GetLength(1);
  }

  public Matrix(int w, int h, T defaultValue = default (T))
  {
   W = w;
   H = h;
   Map = new T[W, H];
  }

  public override bool Equals(object obj)
  {
   if (obj is Matrix<T>)
   {
    return this == (Matrix<T>)obj;
   }

   return base.Equals(obj);
  }

  public override int GetHashCode()
  {
   return base.GetHashCode();
  }

  public static bool operator ==(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return ret;
  }

  public static bool operator !=(Matrix<T> a, Matrix<T> b)
  {
   bool ret = true;
   if (a.Map != b.Map)
    ret = false;
   else if (a.W != b.W)
    ret = false;
   else if (a.H != b.H)
    ret = false;
   return !ret;
  }

  public static Matrix<T> operator +(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Sum(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator -(Matrix<T> a, Matrix<T> b)
  {
   if (a.W != b.W)
    return null;
   else if (a.H != b.H)
    return null;
   else
   {
    Matrix<T> ret = new Matrix<T>(a.W, a.H);
    for (int i = 0; i < a.W; i++)
    {
     for (int j = 0; j < a.H; j++)
     {
      ret[i, j] = Calculator.Difference(a[i, j], b[i, j]);
     }
    }

    return ret;
   }
  }

  public static Matrix<T> operator *(Matrix<T> a, Matrix<T> b)
  {
   if (a.cols != b.rows)
    throw new FormatException("Cannot multiply : a.W = " + a.W.ToString() + " with b.H = " + b.H.ToString());
   else
   {
    Matrix<T> R = new Matrix<T>(a.rows, b.cols);
    for (int i = 0; i < R.rows; i++)
     for (int j = 0; j < R.cols; j++)
      for (int k = 0; k < a.cols; k++)
      {
       R[i, j] = Calculator.Sum(R[i, j], Calculator.Multiply(a[i, k], b[k, j]));
      }

    return R;
   }
  }
 }

 public static class Calculator
 {
  public static T Sum<T>(T a, T b)
  {
   return Number<T>.Sum(a, b);
  }
 }

 public interface ICalculator<T>
 {
  T Sum(T a, T b);
  T Difference(T a, T b);
  int Compare(T a, T b);
  T Multiply(T a, T b);
  T Divide(T a, T b);
  T Divide(T a, int b);
 }

 struct Int32Calculator : ICalculator<Int32>
 {
  public Int32 Sum(Int32 a, Int32 b)
  {
   return a + b;
  }

  public Int32 Difference(Int32 a, Int32 b)
  {
   return a - b;
  }

  public int Compare(Int32 a, Int32 b)
  {
   return Difference(a, b);
  }

  public int Multiply(Int32 a, Int32 b)
  {
   return a * b;
  }

  public int Divide(Int32 a, Int32 b)
  {
   return a / b;
  }
 }

 struct Int64Calculator : ICalculator<Int64>
 {
  public Int64 Sum(Int64 a, Int64 b)
  {
   return a + b;
  }

  public Int64 Difference(Int64 a, Int64 b)
  {
   return a - b;
  }

  public int Compare(Int64 a, Int64 b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Int64 Multiply(Int64 a, Int64 b)
  {
   return a * b;
  }

  public Int64 Divide(Int64 a, Int64 b)
  {
   return a / b;
  }

  public Int64 Divide(Int64 a, int b)
  {
   return a / b;
  }
 }

 struct SingleCalculator : ICalculator<Single>
 {
  public Single Sum(Single a, Single b)
  {
   return a + b;
  }

  public Single Difference(Single a, Single b)
  {
   return a - b;
  }

  public int Compare(Single a, Single b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public Single Multiply(Single a, Single b)
  {
   return a * b;
  }

  public Single Divide(Single a, Single b)
  {
   return a / b;
  }

  public Single Divide(Single a, int b)
  {
   return a / b;
  }
 }

 struct DoubleCalculator : ICalculator<double>
 {
  public double Sum(double a, double b)
  {
   return a + b;
  }

  public double Difference(double a, double b)
  {
   return a - b;
  }

  public int Compare(double a, double b)
  {
   if (a > b)
   {
    return 1;
   }
   else if (a < b)
   {
    return -1;
   }
   else
   {
    return 0;
   }
  }

  public double Multiply(double a, double b)
  {
   return a * b;
  }

  public Double Divide(Double a, Double b)
  {
   return a / b;
  }

  public Double Divide(Double a, int b)
  {
   return a / b;
  }
 }

 struct StringCalculator : ICalculator<string>
 {
  public string Sum(string a, string b)
  {
   return a + b;
  }

  public string Difference(string a, string b)
  {
   if (b.Length < a.Length)
   {
    return a.Substring(0, b.Length);
   }
   else
   {
    return "";
   }
  }

  public int Compare(string a, string b)
  {
   return a.CompareTo(b);
  }

  public string Multiply(string a, string b)
  {
   if (a.Length == 1 && b.Length == 1)
   {
    return ((char)(((byte)a[0] * (byte)b[0]) % 256)) + "";
   }

   int bigLength = Math.Max(a.Length, b.Length);
   while (a.Length < bigLength)
   {
    a = " " + a;
   }

   while (b.Length < bigLength)
   {
    b = " " + b;
   }

   string result = "";
   for (int i = 0; i < bigLength; i++)
   {
    Number<string> numA = a[i] + "";
    Number<string> numB = b[i] + "";
    result += numA * numB;
   }

   return result;
  }

  public String Divide(String a, String b)
  {
   return String.Format("{0} / {1}", a, b);
  }

  public String Divide(String a, int b)
  {
   return String.Format("{0} / {1}", a, b);
  }
 }

 public class Number<T>
 {
  private T value;
  public Number(T value)
  {
   this.value = value;
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

  public static Type GetCalculatorType()
  {
   Type tType = typeof (T);
   Type calculatorType = null;
   if (tType == typeof (Int32))
   {
    calculatorType = typeof (Int32Calculator);
   }
   else if (tType == typeof (Int64))
   {
    calculatorType = typeof (Int64Calculator);
   }
   else if (tType == typeof (Double))
   {
    calculatorType = typeof (DoubleCalculator);
   }
   else if (tType == typeof (string))
   {
    calculatorType = typeof (StringCalculator);
   }
   else
   {
    throw new InvalidCastException(String.Format("Unsupported Type- Type {0} does not have a partner implementation of interface ICalculator<T> and cannot be used in generic arithmetic using type Number<T>", tType.Name));
   }

   return calculatorType;
  }

  private static ICalculator<T> fCalculator = null;
  public static ICalculator<T> Calculator
  {
   get
   {
    if (fCalculator == null)
    {
     MakeCalculator();
    }

    return fCalculator;
   }
  }

  public static void MakeCalculator()
  {
   Type calculatorType = GetCalculatorType();
   fCalculator = Activator.CreateInstance(calculatorType) as ICalculator<T>;
  }

#region operation methods
  public static T Sum(T a, T b)
  {
   return Calculator.Sum(a, b);
  }

  public static T Difference(T a, T b)
  {
   return Calculator.Difference(a, b);
  }

  public static int Compare(T a, T b)
  {
   return Calculator.Compare(a, b);
  }

  public static T Multiply(T a, T b)
  {
   return Calculator.Multiply(a, b);
  }

  public static T Divide(T a, T b)
  {
   return Calculator.Divide(a, b);
  }

  public static T Divide(T a, int b)
  {
   return Calculator.Divide(a, b);
  }

#endregion
#region Operators
  public static implicit operator Number<T>(T a)
  {
   return new Number<T>(a);
  }

  public static implicit operator T(Number<T> a)
  {
   return a.value;
  }

  public static Number<T> operator +(Number<T> a, Number<T> b)
  {
   return Calculator.Sum(a.value, b.value);
  }

  public static Number<T> operator -(Number<T> a, Number<T> b)
  {
   return Calculator.Difference(a, b);
  }

  public static bool operator>(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) > 0;
  }

  public static bool operator <(Number<T> a, Number<T> b)
  {
   return Calculator.Compare(a, b) < 0;
  }

  public static Number<T> operator *(Number<T> a, Number<T> b)
  {
   return Calculator.Multiply(a, b);
  }

  public static Number<T> operator /(Number<T> a, Number<T> b)
  {
   return Calculator.Divide(a, b);
  }

  public static Number<T> operator /(Number<T> a, int b)
  {
   return Calculator.Divide(a, b);
  }
#endregion
 }
}
#region DataStructures
#region IComparable implementation
#endregion
#region Model
#endregion
#region Constructors
#endregion
#region Internal
#region IEqualityComparer implementation
#endregion
#endregion
#region IGraph implementation
#endregion
#region Clique invariants
#endregion
#region Clique methods
#endregion
#region IEquatable implementation
#endregion
#endregion
#region Algorithms
#endregion
#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _1A
{
    class Program
    {
        static void Main(string[] args)
        {

            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int n = s1.Length;
            int a = 0, b = 0,m=0;
            for (int i = 0; i < n; i++)
            {
                if (s1[i] == '+')
                    a++;
                else
                    a--;
                if (s2[i] == '+')
                    b++;
                if (s2[i] == '-')
                    b--;
                if (s2[i] == '?')
                    m++;
            }
            int x = Math.Abs(a - b);
            if (m < x)
                Console.WriteLine("0,000000000000");
            else
            {
                if (m == x)
                    Console.WriteLine("{0:f12}",1.0 / (double)f(m));
                else
                {
                    if((m%2==0&&x%2==0)||(m%2!=0&&x%2!=0))
                        Console.WriteLine("{0:f12}",(double)f(x) / (double)f(m));
                    else
                          Console.WriteLine("0,000000000000");
                }
            }
           // Console.ReadKey();
        }
        static int f(int n)
        {
            if (n == 0)
                return 1;
            else
            {
                int k=1;
                for (int i = 1; i <= n; i++)
                    k = k * i;
                return k;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _1A
{
    class Program
    {
        static void Main(string[] args)
        {

            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int n = s1.Length;
            int a = 0, b = 0,m=0;
            for (int i = 0; i < n; i++)
            {
                if (s1[i] == '+')
                    a++;
                else
                    a--;
                if (s2[i] == '+')
                    b++;
                if (s2[i] == '-')
                    b--;
                if (s2[i] == '?')
                    m++;
            }
            int x = Math.Abs(a - b);
            if (m < x)
                Console.WriteLine("0.000000000000");
            else
            {
                if (m == x)
                    Console.WriteLine("{0:f12}",1.0 / (double)f(m));
                else
                {
                    if((m%2==0&&x%2==0)||(m%2!=0&&x%2!=0))
                        Console.WriteLine("{0:f12}",(double)f(x) / (double)f(m));
                    else
                          Console.WriteLine("0.000000000000");
                }
            }
           // Console.ReadKey();
        }
        static int f(int n)
        {
            if (n == 0)
                return 1;
            else
            {
                int k=1;
                for (int i = 1; i <= n; i++)
                    k = k * i;
                return k;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _1A
{
    class Program
    {
        static void Main(string[] args)
        {

            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int n = s1.Length;
            int a = 0, b = 0,m=0;
            for (int i = 0; i < n; i++)
            {
                if (s1[i] == '+')
                    a++;
                else
                    a--;
                if (s2[i] == '+')
                    b++;
                if (s2[i] == '-')
                    b--;
                if (s2[i] == '?')
                    m++;
            }
            int x = Math.Abs(a - b);
            if (m < x)
                Console.WriteLine("0.000000000");
            else
            {
                if (m == x)
                    Console.WriteLine("{0:f12}",1.0 / (double)f(m));
                else
                {
                    if((m%2==0&&x%2==0)||(m%2!=0&&x%2!=0))
                    {
                        Console.WriteLine("{0:f12}",(double)f(x) / (double)f(m));
                    }
                    else
                          Console.WriteLine("0.000000000");
                }
            }
           // Console.ReadKey();
        }
        static int f(int n)
        {
            if (n == 0)
                return 1;
            else
            {
                int k=1;
                for (int i = 1; i <= n; i++)
                    k = k * i;
                return k;
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int x1 = 0,x2=0,k=0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+')
                    x1++;
                else
                    x1--;
                if (s2[i] == '+')
                    x2++;
                if (s2[i] == '-')
                    x2--;
                if (s2[i] == '?')
                    k++;
            }
            int[,] a = new int[(int)Math.Pow(2, k),k+1];
            int res = 0;
            for (int j = 0; j < (int)Math.Pow(2, k); j++)
            {
                int y=0;
                for (int i = 0; i < k; i++)
                {
                    int l=(int)Math.Pow(2,k-1-i);
                    if (((j/l)%l)%2==0)
                        y++;
                    else
                        y--;
                }
                if (y + x2 == x1)
                    res++;
            }
            Console.WriteLine(((double)res / Math.Pow(2, k)).ToString().Replace(',','.'));
            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace _1A
{
    class Program
    {
        static void Main(string[] args)
        {

            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int n = s1.Length;
            int a = 0, b = 0,m=0;
            for (int i = 0; i < n; i++)
            {
                if (s1[i] == '+')
                    a++;
                else
                    a--;
                if (s2[i] == '+')
                    b++;
                if (s2[i] == '-')
                    b--;
                if (s2[i] == '?')
                    m++;
            }
            int x = Math.Abs(a - b);
            if (m < x)
                Console.WriteLine("0.000000000");
            else
            {
                if (m == x)
                    Console.WriteLine("{0:f9}",1.0 / (double)f(m));
                else
                {
                    if((m%2==0&&x%2==0)||(m%2!=0&&x%2!=0))
                    {
                        Console.WriteLine("{0:f9}",(double)f(x) / (double)f(m));
                    }
                    else
                          Console.WriteLine("0.000000000");
                }
            }
           // Console.ReadKey();
        }
        static int f(int n)
        {
            if (n == 0)
                return 1;
            else
            {
                int k=1;
                for (int i = 1; i <= n; i++)
                    k = k * i;
                return k;
            }
        }
    }
}

#if DEBUG
using System.Reflection;
using System.Threading.Tasks;
#endif

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Globalization;

namespace dr2
{
    class Program
    {
        static string _inputFilename = "input.txt";
        static string _outputFilename = "output.txt";
#if DEBUG
        static bool _useFileInput = false;
#else
        static bool _useFileInput = false;
#endif

        static void Main(string[] args)
        {
            StreamWriter file = null;
            if (_useFileInput)
            {
                Console.SetIn(File.OpenText(_inputFilename));
                file = new StreamWriter(_outputFilename);
                Console.SetOut(file);
            }

#if DEBUG
			if (!_useFileInput)
			{
				Console.SetIn(getInput());
			}
#endif

            try
            {
                solution();
            }
            finally
            {
                if (_useFileInput)
                {
                    file.Close();
                }
            }
        }

        static void solution()
        {
            #region SOLUTION
            var s = Console.ReadLine();
            var got = Console.ReadLine();
            var fp = 0;
            for (int i = 0; i < got.Length; i++)
            {
                if (s[i] == '+')
                {
                    fp++;
                }
                else
                {
                    fp--;
                }
            }

            var dp = 0;
            var ac = 0;
            for (int i = 0; i < s.Length; i++)
            {
                if (got[i] == '?')
                {
                    ac++;
                }
                else if (got[i] == '+')
                {
                    dp++;
                }
                else
                {
                    dp--;
                }
            }

            if (ac == 0)
            {
                if (dp == fp)
                {
                    Console.WriteLine(1);
                }
                else
                {
                    Console.WriteLine(0);
                }

                return;
            }

            var need = 0;
            if (dp * fp > 0)
            {
                need = Math.Abs(dp - fp);
            }
            else if (dp * fp == 0)
            {
                need = Math.Max(dp, fp);
            }
            else
            {
                need = Math.Abs(dp) + Math.Abs(fp);
            }

            if (ac < need)
            {
                Console.WriteLine(0);
                return;
            }

            var fa = new int[11];
            fa[0] = 1;
            for (int i = 1; i < 10 + 1; i++)
            {
                fa[i] = i * fa[i - 1];
            }

            var count = 0;
            var oc = 0;
            for (int i = 0; i <= ac; i++)
            {
                var rem = ac - i;
                count += fa[ac] / (fa[i] * fa[rem]);

                if (i - rem == need)
                {
                    oc += fa[ac] / (fa[i] * fa[rem]);
                }
            }

            var res = (double)oc / (count);
            Console.WriteLine(res.ToString(CultureInfo.InvariantCulture));
            //var n = readInt();
            //var m = readInt();

            //var a = readIntArray();
            //var b = readIntArray();
            #endregion
        }

        static int readInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long readLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static int[] readIntArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => int.Parse(i)).ToArray();
        }

        static long[] readLongArray()
        {
            return Console.ReadLine().Split(' ').Where(i => !string.IsNullOrEmpty(i)).Select(i => long.Parse(i)).ToArray();
        }

#if DEBUG
		static StreamReader getInput()
		{
			var resName = Assembly.GetCallingAssembly().GetManifestResourceNames()[0];
			var resource = Assembly.GetCallingAssembly().GetManifestResourceStream(resName);

			return new StreamReader(resource);
		}
#endif
    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = (total == 0 ? 0 : correct/(decimal)total);
        Console.WriteLine("1.000000000000");//string.Format("{0:0.00000000000}",prob)
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine((total == 0 ? 0 : correct/(decimal)total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 1m ;
        decimal total = 1m;
        total = (decimal)posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.################}",correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = (total == 0 ? 0 : correct/(decimal)total);
        Console.WriteLine(string.Format("{0:0.00000000000000}",prob));
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 1m ;
        decimal total = 1m;

        Console.WriteLine(string.Format("{0:0.################}",correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = (total == 0 ? 0 : correct/(decimal)total);
        Console.WriteLine(string.Format("{0:0.00000000000}",prob));
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 0m ;
        decimal total = 0m;
        total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.00000000000000}",(total == 0 ? 0 : correct/(decimal)total)));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        decimal total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine((total == 0 ? 0 : correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 0m ;
        decimal total = 0m;
        total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.00000000000000}",correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.00000000000000}",(total == 0 ? 0 : correct/(decimal)total)));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 1m ;
        decimal total = 1m;

        Console.WriteLine(string.Format("{0:0.00000000000000}",correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = total == 0 ? 0 : correct/(decimal)total;
        Console.WriteLine(string.Format("{0:0.000000000000}",prob));
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        double prob = total == 0 ? 0 : correct/(double)total;
        Console.WriteLine(string.Format("{0:0.000000000}",prob));
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        int total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }
        decimal prob = (total == 0 ? 0 : correct/(decimal)total);
        Console.WriteLine(prob);
        //string.Format("{0:0.00000000000000}",prob)
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        decimal correct = 1m ;
        decimal total = 1m;
        total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.################}",correct/total));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
public class Test
{
    public static void Main()
    {
        // your code goes here
        string str1 = Console.ReadLine().Trim();
        string str2 = Console.ReadLine().Trim();
        int finalpos = 0 ;
        for(int i = 0 ; i < str1.Length ; i++){
            if(str1[i] == '+')
                finalpos++;
             else
               finalpos--;
        }
        posList = new List<int>();
        Recur(str2,0,0);
        int correct = 0 ;
        decimal total = 0m;
        total = posList.Count;
        foreach(int item in posList){
            if(item == finalpos){
                correct++;
            }
        }

        Console.WriteLine(string.Format("{0:0.00000000000000}",(total == 0 ? 0 : correct/(decimal)total)));
        //
    }
    static List<int> posList;
    public static void Recur(string str , int pos , int strpos){
        if(strpos == str.Length){
            posList.Add(pos);
            return;
        }
        if(str[strpos] == '+'){
            Recur(str,pos+1,strpos+1);
        } else if (str[strpos] == '-'){
            Recur(str,pos-1,strpos + 1);
        } else {
            Recur(str,pos+1,strpos+1);
                Recur(str,pos-1,strpos+1);
        }

    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Text.RegularExpressions;
using System.IO;
using System.Numerics;
using System.Globalization;
using System.Threading;

namespace probleme {
    class Program {
        static void Main(string[] args) {
            //Console.SetIn(new StreamReader("file.txt"));
            int sum = 0, n = 0;
            char[] aux = Console.ReadLine().ToCharArray();
            for (int i = 0; i < aux.Length; i++) {
                if (aux[i] == '?') {
                    n++;
                } else if (aux[i] == '+') {
                    sum++;
                } else {
                    sum--;
                }
            }
            aux = Console.ReadLine().ToCharArray();
            for (int i = 0; i < aux.Length; i++) {
                if (aux[i] == '?') {
                    n++;
                } else if (aux[i] == '+') {
                    sum--;
                } else {
                    sum++;
                }
            }
            if (sum < 0){
                sum = -sum;
            }
            double[] fact = new double[11];
            fact[0] = 1.0;
            for (int i = 1; i <= 10; i++) {
                fact[i] = fact[i - 1] * i;
            }
            double ans = 0.0;
            int test = n - sum;
            if (test % 2 == 0) {
                test /= 2;
                test += sum;
                if (n == 0) {
                    ans = 1.0;
                } else if (test <= n) {
                    ans = (fact[n]/(fact[test]*fact[n-test]))/(1 << n);
                }
            }
            Console.Write(ans.ToString(CultureInfo.CreateSpecificCulture("en-GB")));
            //Console.ReadKey();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            int transmit=0;
            int reseive = 0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int count = 0;
            int count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? 1 : -1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? 1 : -1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                if ((transmit - reseive) % 2 == s1.Length % 2 && (transmit - reseive) < s1.Length && (transmit - reseive) > -s1.Length )
                {
                    int k = (count - (transmit - reseive)) / 2;
                    double result = 1;
                    for(int z = 0; z<k;z++)
                    {
                        result *= (double)(count - z)/(z+1);
                    }
                    Console.WriteLine((result/Math.Pow(2, count)).ToString("0.000000000000").Replace(',', '.'));
                }
                else
                {
                    Console.WriteLine(0);
                }

            }
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            short transmit=0;
            short reseive=0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            short count = 0;
            short count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? (short)1 : (short)-1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? (short)1 : (short)-1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                for(int z = 0; z<= count+1; z++)
                {
                    if (transmit == (reseive + (count - 2 * z)))
                    {
                        if (z != 0 && z != count + 1)
                            count2 += count;
                        else
                            count2++;
                    }
                }
                Console.WriteLine("{0:0.000000000000}",(double)count2/Math.Pow(2, count));
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            int transmit=0;
            int reseive = 0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int count = 0;
            int count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? 1 : -1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? 1 : -1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                if ((transmit - reseive) % 2 == count % 2 && (transmit - reseive) < count && (transmit - reseive) > -count)
                {
                    int k = (count - (transmit - reseive)) / 2;
                    double result = 1;
                    for (int z = 0; z < k; z++)
                    {
                        result *= (double)(count - z) / (z + 1);
                    }
                    Console.WriteLine((result / Math.Pow(2, count)).ToString("0.000000000000").Replace(',', '.'));
                }
                else
                {
                    Console.WriteLine(0);
                }

            }
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            int transmit=0;
            int reseive = 0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int count = 0;
            int count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? 1 : -1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? 1 : -1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                if ((transmit - reseive) % 2 == s1.Length % 2 && (transmit - reseive) < s1.Length && (transmit - reseive) > -s1.Length )
                {
                    int k = (s1.Length - (transmit - reseive)) / 2;
                    double result = 1;
                    for(int z = 0; z<k;z++)
                    {
                        result *= (double)(s1.Length - z)/(z+1);
                    }
                    Console.WriteLine((result/Math.Pow(2, s1.Length)).ToString("0.000000000000").Replace(',', '.'));
                }
                else
                {
                    Console.WriteLine(0);
                }
            }
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            short transmit=0;
            short reseive=0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            short count = 0;
            short count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? (short)1 : (short)-1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? (short)1 : (short)-1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                for(int z = 0; z<= count+1; z++)
                {
                    if (transmit == (reseive + (count - 2 * z)))
                    {
                        if (z != 0 && z != count + 1)
                            count2 += count;
                        else
                            count2++;
                    }
                }
                Console.WriteLine((count2 / Math.Pow(2, count)).ToString("0.000000000000").Replace(',', '.'));
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            short transmit=0;
            short reseive=0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            short count = 0;
            short count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? (short)1 : (short)-1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? (short)1 : (short)-1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                for(int z = 0; z<= count+1; z++)
                {
                    if (transmit == (reseive + (count - 2 * z)))
                    {
                        if (z != 0 && z != count + 1)
                            count2 += count;
                        else
                            count2++;
                    }
                }
                Console.WriteLine((double)count2/Math.Pow(2, count));
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _476b
{
    class Program
    {
        static void Main(string[] args)
        {
            int transmit=0;
            int reseive = 0;
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int count = 0;
            int count2 = 0;
            int i = 0;
            while (i < s1.Length)
            {
                transmit += s1[i] == '+' ? 1 : -1;
                if (s2[i] != '?')
                    reseive += s2[i] == '+' ? 1 : -1;
                else
                    count++;
                i++;
            }
            if(count == 0)
            {
                if (transmit == reseive)
                    Console.WriteLine(1);
                else
                    Console.Write(0);
            }
            else
            {
                if ((transmit - reseive) % 2 == count % 2 && (transmit - reseive) <= count && (transmit - reseive) >= -count)
                {
                    int k = (count - (transmit - reseive)) / 2;
                    double result = 1;
                    for (int z = 0; z < k; z++)
                    {
                        result *= (double)(count - z) / (z + 1);
                    }
                    Console.WriteLine((result / Math.Pow(2, count)).ToString("0.000000000000").Replace(',', '.'));
                }
                else
                {
                    Console.WriteLine(0);
                }

            }
            Console.ReadLine();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;

namespace cf
{
    public class Cf
    {
        private static void Println(int n)
        {
            Console.WriteLine(n);
        }

        private static void Println(String s)
        {
            Console.WriteLine(s);
        }

        private static void Print(int n)
        {
            Console.Write(n);
        }

        private static void Print(String s)
        {
            Console.Write(s);
        }

        public static void Main(String[] args)
        {
            B();
        }

        private static void C()
        {
        }

        private static void A()
        {
            var scanner = new MyScanner();
            var n = scanner.NextInt();
            var m = scanner.NextInt();
            var x2 = n / 2;
            var x1 = n % 2;
            var d = (m - ((x1 + x2) % m)) % m;
            x2 -= d;
            x1 += 2 * d;
            if (x2 < 0)
            {
                Print(-1);
            }
            else
            {
                Print(x1 + x2);
            }
        }

        private static void B()
        {
            var f = new int[11];
            f[0] = 1;
            for (int i = 1; i < 11; i++)
                f[i] = f[i - 1]*i;
            var scanner = new MyScanner();
            var s1 = scanner.NextString();
            var s2 = scanner.NextString();
            var p1 = s1.Count(c => c == '+') - s1.Count(c => c == '-');
            var p2 = s2.Count(c => c == '+') - s2.Count(c => c == '-');
            var d = Math.Abs(p1 - p2);
            var q = s2.Count(c => c == '?');
            if (d > q)
            {
                Print(0);
                return;
            }
            var x = q - d;
            if (x%2 == 1)
            {
                Print(0);
                return;
            }
            x /= 2;
            double pp = ((double)f[q])/(f[x]*f[q - x]);
            Print((pp/Math.Pow(2,q)).ToString());
        }
    }

    class Pair
    {
        public int X;
        public int Y;

        Pair(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
    }
    class MyScanner
    {
        private String[] _buffer;
        private int _pos = 0;

        public int NextInt()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return int.Parse(_buffer[_pos - 1]);
        }

        public String NextString()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return _buffer[_pos - 1];
        }

        public List<int> GetIntList(int n)
        {
            var result = new List<int>(n);
            for (int i = 0; i < n; i++)
                result.Add(NextInt());
            return result;
        }

        public int[] GetIntArray(int n)
        {
            var result = new int[n];
            for (int i = 0; i < n; i++)
                result[i] = (NextInt());
            return result;
        }

    }
}

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;

namespace cf
{
    public class Cf
    {
        private static void Println(int n)
        {
            Console.WriteLine(n);
        }

        private static void Println(String s)
        {
            Console.WriteLine(s);
        }

        private static void Print(int n)
        {
            Console.Write(n);
        }

        private static void Print(String s)
        {
            Console.Write(s);
        }

        public static void Main(String[] args)
        {
            B();
        }

        private static void C()
        {
        }

        private static void A()
        {
            var scanner = new MyScanner();
            var n = scanner.NextInt();
            var m = scanner.NextInt();
            var x2 = n / 2;
            var x1 = n % 2;
            var d = (m - ((x1 + x2) % m)) % m;
            x2 -= d;
            x1 += 2 * d;
            if (x2 < 0)
            {
                Print(-1);
            }
            else
            {
                Print(x1 + x2);
            }
        }

        private static void B()
        {
            var f = new int[11];
            f[0] = 1;
            for (int i = 1; i < 11; i++)
                f[i] = f[i - 1]*i;
            var scanner = new MyScanner();
            var s1 = scanner.NextString();
            var s2 = scanner.NextString();
            var p1 = s1.Count(c => c == '+') - s1.Count(c => c == '-');
            var p2 = s2.Count(c => c == '+') - s2.Count(c => c == '-');
            var d = Math.Abs(p1 - p2);
            var q = s2.Count(c => c == '?');
            if (d > q)
            {
                Print(0);
                return;
            }
            double pp = ((double)f[q])/(f[d]*f[q - d]);
            Print((pp/Math.Pow(2,q)).ToString());
        }
    }

    class Pair
    {
        public int X;
        public int Y;

        Pair(int x, int y)
        {
            this.X = x;
            this.Y = y;
        }
    }
    class MyScanner
    {
        private String[] _buffer;
        private int _pos = 0;

        public int NextInt()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return int.Parse(_buffer[_pos - 1]);
        }

        public String NextString()
        {
            if (_buffer == null)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            if (_buffer.Length <= _pos)
            {
                _buffer = Console.ReadLine().Split(' ');
                _pos = 0;
            }
            _pos++;
            return _buffer[_pos - 1];
        }

        public List<int> GetIntList(int n)
        {
            var result = new List<int>(n);
            for (int i = 0; i < n; i++)
                result.Add(NextInt());
            return result;
        }

        public int[] GetIntArray(int n)
        {
            var result = new int[n];
            for (int i = 0; i < n; i++)
                result[i] = (NextInt());
            return result;
        }

    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            Console.WriteLine("{0:F20}", GetResult(send, received));

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if (incorrectdiff + count > unknown)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            Console.WriteLine(res.Replace(',', '.'));

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if (incorrectdiff + count > unknown)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            Console.WriteLine(res.Replace(',', '.'));

            Console.ReadLine();
        }

        static int Fact(int n)
        {
            int res = 1;
            for (int i = 2; i <= n; i++)
            {
                res *= i;
            }

            return res;
        }

        static int C(int a, int n)
        {
            return (Fact(n) / Fact(a)) / Fact(n - a);
        }

        static double GetResult(string send, string received)
        {
            int plus = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            int diff = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                    {
                        ++diff;
                        ++plus;
                    }
                    else
                        --diff;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if ( Math.Abs(incorrectdiff) > unknown - diff)
                return 0.0;

            return C(plus,unknown) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            Console.WriteLine(res.Replace(',', '.'));

            Console.ReadLine();
        }

        static int Fact(int n)
        {
            int res = 1;
            for (int i = 2; i <= n; i++)
            {
                res *= i;
            }

            return res;
        }

        static int C(int a, int n)
        {
            return (Fact(n) / Fact(a)) / Fact(n - a);
        }

        static double GetResult(string send, string received)
        {
            int plus = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            int diff = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                    {
                        ++diff;
                        ++plus;
                    }
                    else
                        --diff;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if ( Math.Abs(incorrectdiff) > unknown - diff)
                return 0.0;

            return C(plus + incorrectdiff,unknown) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            Console.WriteLine(res.Replace(',', '.'));

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if ( Math.Abs(incorrectdiff) > unknown - count)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            Console.WriteLine("{0:F12}", GetResult(send, received));

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if (incorrectdiff + count > unknown)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            Console.WriteLine(GetResult(send, received));

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if (incorrectdiff + count > unknown)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Linq;

namespace Task_TD
{
    class Program
    {
        const char Forward = '+';
        const char Backward = '-';
        const char Unknown = '?';

        static void Main(string[] args)
        {
            string send = Console.ReadLine();
            string received = Console.ReadLine();

            string res = String.Format ("{0:F12}", GetResult(send, received));
            res.Replace(',', '.');
            Console.WriteLine(res);

            Console.ReadLine();
        }

        static double GetResult(string send, string received)
        {
            if (!received.Contains(Unknown))
                return 1.0;

            int count = 0;
            int incorrectdiff = 0;
            int unknown = 0;
            for (int i = 0; i < send.Length; i++)
            {
                if (received[i] == Unknown)
                {
                    if (send[i] == Forward)
                        ++count;
                    else
                        --count;

                    ++unknown;
                }
                else if (received[i] != send[i])
                {
                    if (send[i] == Forward)
                        --incorrectdiff;
                    else
                        ++incorrectdiff;
                }
            }

            if (incorrectdiff + count > unknown)
                return 0.0;

            return (unknown * (unknown - 1)) / (Math.Pow(2.0, unknown));

        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prB {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif

        static long v = 0;

        static void Perebor(int q, int dr, ref int orig) {
            if(q == 0) {
                if(dr == orig)
                    v++;
                return;
            }
            Perebor(q - 1, dr + 1, ref orig);
            Perebor(q - 1, dr - 1, ref orig);
        }

        static void Main(string[] args) {
            string s1 = reader.ReadLine();
            string s2 = reader.ReadLine();
            int orig = 0;
            foreach(char c in s1) {
                switch(c) {
                    case '+':
                        orig++;
                        break;
                    case '-':
                        orig--;
                        break;
                }
            }
            int dr = 0;
            int q = 0;
            foreach(char c in s2) {
                switch(c) {
                    case '+':
                        dr++;
                        break;
                    case '-':
                        dr--;
                        break;
                    case '?':
                        q++;
                        break;
                }
            }

            Perebor(q, dr, ref orig);
            long all = (long) Math.Pow(2, q);
            double ans = v / (double) all;
            writer.WriteLine("{0:0.000000000000}", ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.IO;

namespace prB {

    class Program {
#if ONLINE_JUDGE
        private static readonly StreamReader reader = new StreamReader(Console.OpenStandardInput(1024 * 10), System.Text.Encoding.ASCII, false, 1024 * 10);
        private static readonly StreamWriter writer = new StreamWriter(Console.OpenStandardOutput(1024 * 10), System.Text.Encoding.ASCII, 1024 * 10);
#else
        private static readonly StreamWriter writer = new StreamWriter("output");
        private static readonly StreamReader reader = new StreamReader("input");
#endif

        static long v = 0;

        static void Perebor(int q, int dr, ref int orig) {
            if(q == 0) {
                if(dr == orig)
                    v++;
                return;
            }
            Perebor(q - 1, dr + 1, ref orig);
            Perebor(q - 1, dr - 1, ref orig);
        }

        static void Main(string[] args) {
            string s1 = reader.ReadLine();
            string s2 = reader.ReadLine();
            int orig = 0;
            foreach(char c in s1) {
                switch(c) {
                    case '+':
                        orig++;
                        break;
                    case '-':
                        orig--;
                        break;
                }
            }
            int dr = 0;
            int q = 0;
            foreach(char c in s2) {
                switch(c) {
                    case '+':
                        dr++;
                        break;
                    case '-':
                        dr--;
                        break;
                    case '?':
                        q++;
                        break;
                }
            }

            Perebor(q, dr, ref orig);
            long all = (long) Math.Pow(2, q);
            double ans = v / (double) all;
            writer.WriteLine(ans);

            writer.Flush();
#if !ONLINE_JUDGE
            writer.Close();
#endif
        }
        private static int Next() {
            int c;
            int res = 0;
            do {
                c = reader.Read();
                if(c == -1)
                    return res;
            } while(c != '-' && (c < '0' || c > '9'));
            int sign = 1;
            if(c == '-') {
                sign = -1;
                c = reader.Read();
            }
            res = c - '0';
            while(true) {
                c = reader.Read();
                if(c < '0' || c > '9')
                    return res * sign;
                res *= 10;
                res += c - '0';
            }
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication1.Dynamic
{
    class _476B
    {
        public static int Main()
        {
            var s1 = Console.ReadLine();
            var s2 = Console.ReadLine();
            var possible = new List<string>();
            possible.Add(s2);
            for(var i = 0; i < s2.Length; i++)
            {
                if(s2[i] == '?')
                {
                    var newAll = new List<string>();
                    for (var j = 0; j < possible.Count; j++)
                    {
                        var cur = possible[j].ToCharArray().ToArray();
                        cur[i] = '+';
                        newAll.Add(new string(cur));
                        cur[i] = '-';
                        newAll.Add(new string(cur));
                    }
                    possible = newAll;
                }
            }
            var result = 0;
            for(var i = 0; i < s1.Length; i++)
            {
                if(s1[i] == '-')
                {
                    result -= 1;
                } else
                {
                    result += 1;
                }
            }
            double good = 0;
            for(var i = 0; i < possible.Count; i++)
            {
                var res = 0;
                for(var j = 0; j < possible[i].Length; j++)
                {
                    if(possible[i][j] == '-')
                    {
                        res -= 1;
                    } else
                    {
                        res += 1;
                    }
                }
                if(res == result)
                {
                    good++;
                }
            }
            Console.WriteLine(good/possible.Count);
            return 0;
        }
    }
}

// done
/***************************************************************************
* Title       : Dreamoon and WiFi
* URL         : http://codeforces.com/problemset/problem/476/B
* Occasion    : Codeforces Round #273 (Div. 2)
* Date        : Sep 13 2017
* Complexity  : O(n) 46ms, Space O(n)
* Author      : Atiq Rahman
* Status      : Accepted
* Notes       : input limit 10^9 requires larger data type than int
* meta        : tag-combinatories, tag-math, tag-easy
***************************************************************************/
using System;

class ProbComb {
  int d;
  int d2;
  int q;
  double positive_count;

  // Take input strings and represent them in d, d2 and q
  public void TakeInput() {
    string s1 = Console.ReadLine();
    string s2 = Console.ReadLine();

    d = d2 = q = 0;
    positive_count = 0;
    foreach (char ch in s1)
      switch (ch) {
        case '+':
          d++; break;
        case '-':
          d--; break;
        default:
          break;
      }
    foreach (char ch in s2)
      switch (ch) {
        case '+':
          d2++; break;
        case '-':
          d2--; break;
        case '?':
          q++; break;
        default:
          break;
      }
  }

  public double GetProbability() {
    if (Math.Abs(d - d2) > q)
      return 0.0;
    Comb(d2, 0);
    double res = positive_count / (q==0?1:Math.Pow(2, q));
    return res;
  }

  public void Comb(int v, int k) {
    if (k == q) {
      if (v == d)
        positive_count++;
      return;
    }
    Comb(v + 1, k+1);
    Comb(v - 1, k+1);
  }
}

public class CF_Solution {
  public static void Main() {
    ProbComb PC = new ProbComb();
    PC.TakeInput();
    Console.WriteLine("{0:F9}", PC.GetProbability());
    // Console.WriteLine(PC.GetProbability());
  }
}

// done
/***************************************************************************
* Title       : Dreamoon and WiFi
* URL         : http://codeforces.com/problemset/problem/476/B
* Occasion    : Codeforces Round #273 (Div. 2)
* Date        : Sep 13 2017
* Complexity  : O(n) 46ms, Space O(n)
* Author      : Atiq Rahman
* Status      : Accepted
* Notes       : input limit 10^9 requires larger data type than int
* meta        : tag-combinatories, tag-math, tag-easy
***************************************************************************/
using System;

class ProbComb {
  int d;
  int d2;
  int q;
  double positive_count;

  // Take input strings and represent them in d, d2 and q
  public void TakeInput() {
    string s1 = Console.ReadLine();
    string s2 = Console.ReadLine();

    d = d2 = q = 0;
    positive_count = 0;
    foreach (char ch in s1)
      switch (ch) {
        case '+':
          d++; break;
        case '-':
          d--; break;
        default:
          break;
      }
    foreach (char ch in s2)
      switch (ch) {
        case '+':
          d2++; break;
        case '-':
          d2--; break;
        case '?':
          q++; break;
        default:
          break;
      }
  }

  public double GetProbability() {
    if (Math.Abs(d - d2) > q)
      return 0.0;
    Comb(d2, 0);
    double res = positive_count / (q==0?1:(q * q));
    return res;
  }

  public void Comb(int v, int k) {
    if (k == q) {
      if (v == d)
        positive_count++;
      return;
    }
    Comb(v + 1, k+1);
    Comb(v - 1, k+1);
  }
}

public class CF_Solution {
  public static void Main() {
    ProbComb PC = new ProbComb();
    PC.TakeInput();
    Console.WriteLine("{0:F12}", PC.GetProbability());
  }
}

// done
/***************************************************************************
* Title       : Dreamoon and WiFi
* URL         : http://codeforces.com/problemset/problem/476/B
* Occasion    : Codeforces Round #273 (Div. 2)
* Date        : Sep 13 2017
* Complexity  : O(n) 46ms, Space O(n)
* Author      : Atiq Rahman
* Status      : Accepted
* Notes       : input limit 10^9 requires larger data type than int
* meta        : tag-combinatories, tag-math, tag-easy
***************************************************************************/
using System;

class ProbComb {
  int d;
  int d2;
  int q;
  double positive_count;

  // Take input strings and represent them in d, d2 and q
  public void TakeInput() {
    string s1 = Console.ReadLine();
    string s2 = Console.ReadLine();

    d = d2 = q = 0;
    positive_count = 0;
    foreach (char ch in s1)
      switch (ch) {
        case '+':
          d++; break;
        case '-':
          d--; break;
        default:
          break;
      }
    foreach (char ch in s2)
      switch (ch) {
        case '+':
          d2++; break;
        case '-':
          d2--; break;
        case '?':
          q++; break;
        default:
          break;
      }
  }

  public double GetProbability() {
    if (Math.Abs(d - d2) > q)
      return 0.0;
    Comb(d2, 0);
    double res = positive_count / (q==0?1:(q * q));
    return res;
  }

  public void Comb(int v, int k) {
    if (k == q) {
      if (v == d)
        positive_count++;
      return;
    }
    Comb(v + 1, k+1);
    Comb(v - 1, k+1);
  }
}

public class CF_Solution {
  public static void Main() {
    ProbComb PC = new ProbComb();
    PC.TakeInput();
    //Console.WriteLine("{0:F12}", PC.GetProbability());
    Console.WriteLine(PC.GetProbability());
  }
}

// done
/***************************************************************************
* Title       : Dreamoon and WiFi
* URL         : http://codeforces.com/problemset/problem/476/B
* Occasion    : Codeforces Round #273 (Div. 2)
* Date        : Sep 13 2017
* Complexity  : O(n) 46ms, Space O(n)
* Author      : Atiq Rahman
* Status      : Accepted
* Notes       : input limit 10^9 requires larger data type than int
* meta        : tag-combinatories, tag-math, tag-easy
***************************************************************************/
using System;

class ProbComb {
  int d;
  int d2;
  int q;
  double positive_count;

  // Take input strings and represent them in d, d2 and q
  public void TakeInput() {
    string s1 = Console.ReadLine();
    string s2 = Console.ReadLine();

    d = d2 = q = 0;
    positive_count = 0;
    foreach (char ch in s1)
      switch (ch) {
        case '+':
          d++; break;
        case '-':
          d--; break;
        default:
          break;
      }
    foreach (char ch in s2)
      switch (ch) {
        case '+':
          d2++; break;
        case '-':
          d2--; break;
        case '?':
          q++; break;
        default:
          break;
      }
  }

  public double GetProbability() {
    if (Math.Abs(d - d2) > q)
      return 0.0;
    Comb(d2, 0);
    double res = positive_count / (q==0?1:Math.Pow(2, q));
    return res;
  }

  public void Comb(int v, int k) {
    if (k == q) {
      if (v == d)
        positive_count++;
      return;
    }
    Comb(v + 1, k+1);
    Comb(v - 1, k+1);
  }
}

public class CF_Solution {
  public static void Main() {
    ProbComb PC = new ProbComb();
    PC.TakeInput();
    Console.WriteLine("{0:F12}", PC.GetProbability());
    // Console.WriteLine(PC.GetProbability());
  }
}

using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Numerics;
using System.Text;

namespace contest
{

    class contest
    {

        static void Main(string[] args)
        {

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //var input = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //int n = int.Parse(Console.ReadLine());

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for (int i = 0; i < n; i++)
            //{
            //    input[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int n = num[0];
            //int m = num[1];

            //int n = int.Parse(Console.ReadLine());
            //var arr = new int[n][];//Console.ReadLine().Split().Select(int.Parse).ToArray();
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            //int n = int.Parse(Console.ReadLine());
            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();

            //var arr = new int[n][];
            //for(int i =0; i< n; i++)
            //{
            //    arr[i] = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //}

            //var num = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //var arr = Console.ReadLine().Split().Select(int.Parse).ToArray();
            //int t = num[0];
            //int k = num[1];

            string s = Console.ReadLine();
            string t = Console.ReadLine();
            int len = s.Length;

            int original = 0;
            for(int i=0; i< len; i++)
            {
                char cur = s[i];
                if (cur == '+') original++;
                else original--;

            }

            int dre = 0;
            int cntQ = 0;
            for (int i = 0; i < len; i++)
            {
                char cur = t[i];
                if (cur == '+') dre++;
                else if(cur == '-')dre--;
                else cntQ++;
            }

            double ans = 1.0;

            if(cntQ==0 && original==dre) Console.WriteLine(ans);
            else if (cntQ == 0 && original != dre) Console.WriteLine(0.0);
            else
            {
                int dif = Math.Abs(original-dre);
                if (dif > cntQ) ans = 0.0;
                else if (dif % 2 != cntQ % 2) ans = 0.0;
                else
                {
                    double d = Math.Pow(2,cntQ);
                    double count = 0;
                    for(int i=0; i<(1<<cntQ); i++)
                    {
                        int tmp = i;
                        int cnt = 0;
                        while(tmp>0)
                        {
                            if ((tmp & 1) == 1) cnt++;
                            tmp >>= 1;
                        }
                        if ((cntQ-cnt) - (cnt) == dif) count++;
                    }
                    ans = count / d;
                }

                Console.WriteLine(ans);
            }

            //Console.WriteLine();

        }

    }

    class Segment
    {
        //public int[] arr;
        public Tuple<int, int, int, int, int>[] arr;
        int n;

        public Segment(int n)
        {
            this.n = n * 2;
            //arr = Enumerable.Range(0, n*2).ToArray();
            //arr = new int[this.n];
            arr = new Tuple<int, int, int, int, int>[this.n];
            for (int i = 0; i < this.n; i++)
            {
                arr[i] = Tuple.Create(0, 0, 0, 0, 0);
            }

        }

        public void update(int i, int x)
        {
            i = (n / 2) + i - 1;
            //arr[i] = 1;
            if (x == 2) arr[i] = Tuple.Create(1, 0, 0, 0, 0);
            else if (x == 0) arr[i] = Tuple.Create(0, 1, 0, 0, 0);
            else if (x == 1) arr[i] = Tuple.Create(0, 0, 1, 0, 0);
            else if (x == 6) arr[i] = Tuple.Create(0, 0, 0, 1, 0);
            else if (x == 7) arr[i] = Tuple.Create(0, 0, 0, 0, 1);

            while (i > 0)
            {
                i = (i - 1) / 2;
                //arr[i] = Math.Max(arr[i*2+1], arr[i*2+2]);
                //if (arr[i * 2 + 1] > arr[i * 2 + 2])
                //{
                //    arr[i] = arr[i*2+1];
                //}
                //else
                //{
                //    arr[i] = arr[i*2+2];
                //}
                //arr[i] = arr[i * 2 + 1] + arr[i * 2 + 2];
                arr[i] = Tuple.Create(arr[i * 2 + 1].Item1 + arr[i * 2 + 2].Item1,
                    arr[i * 2 + 1].Item2 + arr[i * 2 + 2].Item2,
                    arr[i * 2 + 1].Item3 + arr[i * 2 + 2].Item3,
                    arr[i * 2 + 1].Item4 + arr[i * 2 + 2].Item4,
                    arr[i * 2 + 1].Item5 + arr[i * 2 + 2].Item5);
            }

        }

        //call : query(a,b, 0, 0, n)
        public Tuple<int, int, int, int, int> query(int a, int b, int k, int l, int r)
        {
            if (r <= a || b <= l) return Tuple.Create(0, 0, 0, 0, 0);
            if (a <= l && r <= b) return arr[k];
            else
            {

                var vl = query(a, b, k * 2 + 1, l, (l + r) / 2);
                var vr = query(a, b, k * 2 + 2, (l + r) / 2, r);

                //if (vl.Item4 > vr.Item4)
                //{
                //    return vl;
                //}
                ////else if (vl.Item4 == vr.Item4)
                ////{
                ////    if (countA >= countB) return vr;
                ////    else return vl;
                ////}
                //else return vr;

                return Tuple.Create(vl.Item1 + vr.Item1,
   vl.Item2 + vr.Item2,
   vl.Item3 + vr.Item3,
  vl.Item4 + vr.Item4,
   vl.Item5 + vr.Item5);

                //return Math.Max(vl, vr);
                //return vl
                int countA = 0;
                int countB = 0;
                if (vl.Item1 == 0) countA++;
                if (vl.Item2 == 0) countA++;
                if (vl.Item3 == 0) countA++;
                if (vl.Item4 == 0) countA++;
                if (vl.Item5 == 0) countA++;

                if (vr.Item1 == 0) countB++;
                if (vr.Item2 == 0) countB++;
                if (vr.Item3 == 0) countB++;
                if (vr.Item4 == 0) countB++;
                if (vr.Item5 == 0) countB++;

                if ((vl.Item1 == 0 && vr.Item1 > 0))
                {
                    return vr;
                }
                else if ((vl.Item1 > 0 && vr.Item1 == 0))
                {
                    return vl;
                }
                else if ((vl.Item2 == 0 && vr.Item2 > 0))
                {
                    return vr;
                }
                else if ((vl.Item2 > 0 && vr.Item2 == 0))
                {
                    return vl;
                }
                else if ((vl.Item3 == 0 && vr.Item3 > 0))
                {
                    return vr;
                }
                else if ((vl.Item3 > 0 && vr.Item3 == 0))
                {
                    return vl;
                }
                else if ((vl.Item4 == 0 && vr.Item4 > 0))
                {
                    return vr;
                }
                else if ((vl.Item4 > 0 && vr.Item4 == 0))
                {
                    return vl;
                }
                else if ((vl.Item5 == 0 && vr.Item5 > 0))
                {
                    return vr;
                }
                else if ((vl.Item5 > 0 && vr.Item5 == 0))
                {
                    return vl;
                }

                if (vl.Item4 > vr.Item4)
                {
                    return vl;
                }
                else if (vl.Item4 == vr.Item4)
                {
                    if (countA >= countB) return vr;
                    else return vl;
                }
                else return vr;

                //if (countA <= countB) return vl;
                //else return vr;
            }
        }

    }

    class UnionFind
    {
        public int[] path;

        public UnionFind(int n)
        {
            path = new int[n];

            for (int i = 0; i < n; i++)
            {
                path[i] = i;
            }

        }

        private int root(int i)
        {
            while (i != path[i])
            {
                path[i] = path[path[i]];
                i = path[i];
            }
            return i;
        }

        public bool find(int p, int q)
        {
            return root(p) == root(q);
        }

        public void unite(int p, int q)
        {
            int i = root(p);
            int j = root(q);
            path[i] = j;
        }

    }
}

#region imports
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

#endregion

namespace CodeForces
{
    class Problem
    {
        const bool IsContest = true;

        private void Solve()
        {
            var dest = _.NextToken().ToCharArray().Select(x => x == '+' ? 1 : -1).Sum();
            var input = _.NextToken().ToCharArray();
            var tempDest = input.Select(x => x == '+' ? 1 : (x == '-' ? -1 : 0)).Sum();
            var nq = input.Count(x => x == '?');
            _.WriteLine(Answer(nq, Math.Abs(dest - tempDest)).ToString("F9", CultureInfo.InvariantCulture));
        }

        decimal Answer(int n, int d)
        {
            return (n - d) % 2 == 0 ? BinomialProb(n, Math.Abs((n - d)/2)) : 0;
        }

        decimal BinomialProb(int n, int k)
        {
            if (n == 0) return 1;
            return k > n ? 0 : Divide(BinCoef(n, k), BigInteger.Pow(2, n));
        }

        private decimal Divide(BigInteger x, BigInteger y)
        {
            var gcd = BigInteger.GreatestCommonDivisor(x, y);
            x = x / gcd;
            y = y / gcd;
            return (decimal)x / (decimal)y;
        }

        BigInteger BinCoef(int n, int k)
        {

            return Prod(k + 1, n) / Prod(2, n - k);
        }

        BigInteger Prod(int s, int t)
        {
            var result = BigInteger.One;
            for (var i = s; i <= t; i++)
            {
                result *= i;
            }
            return result;
        }

        #region shit
        private readonly InOut _ = new InOut(IsContest);
        static void Main(string[] args)
        {
            var p = new Problem();
            p.Solve();
            p._.Close();
        }
    }
    class InOut
    {
        private const string InputFile = "input.txt";
        private const string OutputFile = "output.txt";
        public StreamWriter Cout { get; private set; }
        public StreamReader Cin { get; private set; }
        private void SetConsoleIo()
        {
            Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));
            Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));
        }
        private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }
        public InOut() { SetConsoleIo(); }
        public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }
        public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }
        public void WriteLine(object x) { Cout.WriteLine(x); }
        public void Close() { Cin.Close(); Cout.Close(); }
        public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }
        private int _pos;
        private string[] _tokens;

        private string[] NextStringArray() { return Cin.ReadLine().Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }
        public string NextToken()
        {
            while (_tokens == null || _pos == _tokens.Length)
            {
                // ReSharper disable once PossibleNullReferenceException
                _tokens = NextStringArray();
                _pos = 0;
            }
            return _tokens[_pos++];
        }
        public int NextInt() { return int.Parse(NextToken()); }
        public long NextLong() { return long.Parse(NextToken()); }
        public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }
        public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }
        public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }
        #endregion
    }
}

#region imports
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

#endregion

namespace CodeForces
{
    class Problem
    {
        const bool IsContest = true;

        private void Solve()
        {
            var dest = _.NextToken().ToCharArray().Select(x => x == '+' ? 1 : -1).Sum();
            var input = _.NextToken().ToCharArray();
            var tempDest = input.Select(x => x == '+' ? 1 : (x == '-' ? -1 : 0)).Sum();
            var nq = input.Count(x => x == '?');
            _.WriteLine(Answer(nq, Math.Abs(dest - tempDest)).ToString("F9", CultureInfo.InvariantCulture));
        }

        decimal Answer(int n, int d)
        {
            return (n - d) % 2 == 0 ? BinomialProb(n, (n - d)/2) : 0;
        }

        decimal BinomialProb(int n, int k)
        {
            if (n == 0) return 1;
            return k > n ? 0 : Divide(BinCoef(n, k), BigInteger.Pow(2, n));
        }

        private decimal Divide(BigInteger x, BigInteger y)
        {
            var gcd = BigInteger.GreatestCommonDivisor(x, y);
            x = x / gcd;
            y = y / gcd;
            return (decimal)x / (decimal)y;
        }

        BigInteger BinCoef(int n, int k)
        {

            return Prod(k + 1, n) / Prod(2, n - k);
        }

        BigInteger Prod(int s, int t)
        {
            var result = BigInteger.One;
            for (var i = s; i <= t; i++)
            {
                result *= i;
            }
            return result;
        }

        #region shit
        private readonly InOut _ = new InOut(IsContest);
        static void Main(string[] args)
        {
            var p = new Problem();
            p.Solve();
            p._.Close();
        }
    }
    class InOut
    {
        private const string InputFile = "input.txt";
        private const string OutputFile = "output.txt";
        public StreamWriter Cout { get; private set; }
        public StreamReader Cin { get; private set; }
        private void SetConsoleIo()
        {
            Cin = new StreamReader(new BufferedStream(Console.OpenStandardInput()));
            Cout = new StreamWriter(new BufferedStream(Console.OpenStandardOutput()));
        }
        private void SetFileIo(string inputFile, string outputFile) { Cin = new StreamReader(inputFile); Cout = new StreamWriter(outputFile); }
        public InOut() { SetConsoleIo(); }
        public InOut(string inputFile, string outputFile) { SetFileIo(inputFile, outputFile); }
        public InOut(bool isContest) { if (isContest) SetConsoleIo(); else SetFileIo(InputFile, OutputFile); }
        public void WriteLine(object x) { Cout.WriteLine(x); }
        public void Close() { Cin.Close(); Cout.Close(); }
        public void WriteLine(string format, params object[] args) { Cout.WriteLine(format, args); }
        private int _pos;
        private string[] _tokens;

        private string[] NextStringArray() { return Cin.ReadLine().Split(" \t".ToCharArray(), StringSplitOptions.RemoveEmptyEntries); }
        public string NextToken()
        {
            while (_tokens == null || _pos == _tokens.Length)
            {
                // ReSharper disable once PossibleNullReferenceException
                _tokens = NextStringArray();
                _pos = 0;
            }
            return _tokens[_pos++];
        }
        public int NextInt() { return int.Parse(NextToken()); }
        public long NextLong() { return long.Parse(NextToken()); }
        public double NextDouble() { return double.Parse(NextToken(), CultureInfo.InvariantCulture); }
        public int[] NextIntArray() { return NextStringArray().Select(int.Parse).ToArray(); }
        public long[] NextLongArray() { return NextStringArray().Select(long.Parse).ToArray(); }
        #endregion
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string signal = Console.ReadLine();
        string inner = Console.ReadLine();
        int path = 0, wrPath = 0, qMark = 0;

        for (int i = 0; i < signal.Length; ++i)
        {
            if (signal[i] == '+') path++;
            else path--;

            if (inner[i] == '+') wrPath++;
            else if (inner[i] == '-') wrPath--;
            else qMark++;
        }

        if (wrPath == path && qMark == 0) { Console.WriteLine("{0:F12}",1); return; }
        if(Math.Abs(path - wrPath) > qMark) { Console.WriteLine("{0:F12}", 0); return; }

        int plusCount = 0, minusCount = 0, k = wrPath, qMarkCount = 0;
        while (qMarkCount != qMark)
        {
            if (k == path) { plusCount++; qMarkCount++; }
            else if (k < path) { plusCount++; qMarkCount++; }
            else /* k > path */ { minusCount++; qMarkCount++; }
            k++;
        }
        int grater = plusCount > minusCount ? plusCount : minusCount;
        if (plusCount == 0 || minusCount == 0) { Console.WriteLine("{0:F12}", 1 / Math.Pow(2, grater)); return; }
        double ver = (Factorial(qMark) / (Factorial(qMark - grater) * Factorial(qMark - (qMark - grater))));
        Console.WriteLine("{0:F12}",1/ver);
     }

    static double Factorial(int t)
    {
        int ans = 1;
        for(int i = 1; i <= t; ++i)
        {
            ans *= i;
        }
        return (double)ans;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string signal = Console.ReadLine();
        string inner = Console.ReadLine();
        int path = 0, wrPath = 0, qMark = 0;

        for (int i = 0; i < signal.Length; ++i)
        {
            if (signal[i] == '+') path++;
            else path--;

            if (inner[i] == '+') wrPath++;
            else if (inner[i] == '-') wrPath--;
            else qMark++;
        }

        if (wrPath == path && qMark == 0) { Console.WriteLine("{0:F12}",1); return; }
        if(path - wrPath > qMark) { Console.WriteLine("{0:F12}", 0); return; }

        int plusCount = 0, minusCount = 0, k = 0, qMarkCount = 0;
        while (qMarkCount != qMark)
        {
            if (k == path) { plusCount++; qMarkCount++; }
            else if (k < path) { plusCount++; qMarkCount++; }
            else { minusCount++; qMarkCount++; }
            k++;
        }
        int grater = plusCount > minusCount ? plusCount : minusCount;
        double ver = (Factorial(qMark) / (Factorial(qMark - grater) * Factorial(qMark - (qMark - grater))));
        Console.WriteLine("{0:F12}",1/ver);
     }

    static double Factorial(int t)
    {
        int ans = 1;
        for(int i = 1; i <= t; ++i)
        {
            ans *= i;
        }
        return (double)ans;
    }
}

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string signal = Console.ReadLine();
        string inner = Console.ReadLine();
        int[] plus = new int[2] { signal.Count(z => z == '+'), inner.Count(z => z == '+') };
        int[] minus = new int[2] { signal.Count(z => z == '-'), inner.Count(z => z == '-') };
        int qMark = inner.Count(z => z == '?');
        double ans = 0;
        if(qMark == 0)
        {
            if (plus[0] == plus[1] && minus[0] == minus[1]) ans = 1;
            else ans = 0;
        }
        else
        {
            if(plus[0] > plus[1] && minus[0] > minus[1])
            {
                ans = (Factorial(qMark) / (Factorial(qMark - (plus[0] - plus[1])) * Factorial(plus[0] - plus[1]))) / Math.Pow(2,qMark);
            }
        }

        Console.WriteLine("{0:F12}",ans);
     }

    static double Factorial(int t)
    {
        int ans = 1;
        for(int i = 1; i <= t; ++i)
        {
            ans *= i;
        }
        return (double)ans;
    }
}

using System;

namespace DreamoonAndWifi
{
    class Dreamoon
    {
        string initial;
        string recieved;
        int iPlus = 0; int iMinus = 0;
        int rPlus = 0; int rMinus = 0; int rQuest = 0;
        double prob = 0;
        int questAsPlus = 0;
        int questAsMinus = 0;
        double result;

        public void countProbability()
        {
            initial = Console.ReadLine();
            recieved = Console.ReadLine();

            for (int i = 0; i < initial.Length; i++)
            {
                switch (initial[i])
                {
                    case '+':
                        iPlus++;
                        break;
                    case '-':
                        iMinus++;
                        break;
                    default:
                        break;
                }
                switch (recieved[i])
                {
                    case '+':
                        rPlus++;
                        break;
                    case '-':
                        rMinus++;
                        break;
                    case '?':
                        rQuest++;
                        break;
                    default:
                        break;
                }
            }
            int originalQuest = rQuest;
            int originalPlus = rPlus;
            int originalMinus = rMinus;

            if (rMinus == iMinus && rPlus == iPlus) prob = 1;
            else if (iMinus < rMinus || iPlus < rPlus) prob = 0;
            else
            {
                if (iMinus > rMinus)
                {
                    while (iMinus > rMinus && rQuest > 0)
                    {
                        rMinus++;
                        rQuest--;
                        questAsMinus++;
                    }
                }
                if (iPlus > rPlus)
                {
                    while (iPlus > rPlus && rQuest > 0)
                    {
                        rPlus++;
                        rQuest--;
                        questAsPlus++;
                    }
                }

                if (rMinus != iMinus || rPlus != iPlus) prob = 0;
                else
                {
                    while (questAsMinus > 0)
                    {
                        questAsMinus--;
                    }

                    if (questAsMinus > 0)
                    {
                        result = Math.Pow(0.5, questAsMinus);
                    }
                    else if (questAsPlus > 0)
                    {
                        result = Math.Pow(0.5, questAsPlus);
                    }

                    prob = result;
                }

            }
            Console.WriteLine(prob);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Dreamoon d = new Dreamoon();
            d.countProbability();
        }
    }
}

using System;

namespace DreamoonAndWifi
{
    class BC
    {
        public static long combination(long n, long r)
        {
            long i;
            long ans;
            long x;
            long k = 1;

            x = Math.Max(r, n - r);
            ans = 1;
            for (i = n; i > x; i--)
            {
                ans = ans * i;
                ans = ans / k;
                k++;
            }
            return ans;

        }
    }
    class Dreamoon
    {
        string initial;
        string recieved;
        int iPlus = 0; int iMinus = 0;
        int rPlus = 0; int rMinus = 0; int rQuest = 0;
        double prob = 0;
        int questAsPlus = 0;
        int questAsMinus = 0;
        double result;
        int endPosition = 0;
        int endPositionR = 0;

        public void countProbability()
        {
            initial = Console.ReadLine();
            recieved = Console.ReadLine();

            for (int i = 0; i < initial.Length; i++)
            {
                switch (initial[i])
                {
                    case '+':
                        iPlus++;
                        endPosition++;
                        break;
                    case '-':
                        iMinus++;
                        endPosition--;
                        break;
                    default:
                        break;
                }
                switch (recieved[i])
                {
                    case '+':
                        rPlus++;
                        endPositionR++;
                        break;
                    case '-':
                        rMinus++;
                        endPositionR--;
                        break;
                    case '?':
                        rQuest++;
                        break;
                    default:
                        break;
                }
            }
            int originalQuest = rQuest;
            int originalPlus = rPlus;
            int originalMinus = rMinus;

            if (rMinus == iMinus && rPlus == iPlus) prob = 1;
            else if (iMinus < rMinus || iPlus < rPlus) prob = 0;
            else
            {
                if (iMinus > rMinus)
                {
                    while (iMinus > rMinus && rQuest > 0)
                    {
                        rMinus++;
                        rQuest--;
                        questAsMinus++;
                    }
                }
                if (iPlus > rPlus)
                {
                    while (iPlus > rPlus && rQuest > 0)
                    {
                        rPlus++;
                        rQuest--;
                        questAsPlus++;
                    }
                }

                if (rMinus != iMinus || rPlus != iPlus) prob = 0;
                else
                {
                    int distance = Math.Abs(endPosition - endPositionR);
                    if (endPosition < endPositionR) distance = -distance;

                    Console.WriteLine("distance: {0}", distance);
                    Console.WriteLine("minus: {0}",questAsMinus);
                    Console.WriteLine("plus: {0}", questAsPlus);

                    double possibleWays = BC.combination(questAsMinus + questAsPlus, questAsPlus);
                    Console.WriteLine("possible ways: {0}", possibleWays);

                    prob = possibleWays / Math.Pow(2, originalQuest);
                }

            }
            Console.WriteLine(prob);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Dreamoon d = new Dreamoon();
            d.countProbability();
        }
    }
}

using System;

namespace DreamoonAndWifi
{
    class BC
    {
        public static long combination(long n, long r)
        {
            long i;
            long ans;
            long x;
            long k = 1;

            x = Math.Max(r, n - r);
            ans = 1;
            for (i = n; i > x; i--)
            {
                ans = ans * i;
                ans = ans / k;
                k++;
            }
            return ans;

        }
    }
    class Dreamoon
    {
        string initial;
        string recieved;
        int iPlus = 0; int iMinus = 0;
        int rPlus = 0; int rMinus = 0; int rQuest = 0;
        double prob = 0;
        int questAsPlus = 0;
        int questAsMinus = 0;
        double result;
        int endPosition = 0;
        int endPositionR = 0;

        public void countProbability()
        {
            initial = Console.ReadLine();
            recieved = Console.ReadLine();

            for (int i = 0; i < initial.Length; i++)
            {
                switch (initial[i])
                {
                    case '+':
                        iPlus++;
                        endPosition++;
                        break;
                    case '-':
                        iMinus++;
                        endPosition--;
                        break;
                    default:
                        break;
                }
                switch (recieved[i])
                {
                    case '+':
                        rPlus++;
                        endPositionR++;
                        break;
                    case '-':
                        rMinus++;
                        endPositionR--;
                        break;
                    case '?':
                        rQuest++;
                        break;
                    default:
                        break;
                }
            }
            int originalQuest = rQuest;
            int originalPlus = rPlus;
            int originalMinus = rMinus;

            if (rMinus == iMinus && rPlus == iPlus) prob = 1;
            else if (iMinus < rMinus || iPlus < rPlus) prob = 0;
            else
            {
                if (iMinus > rMinus)
                {
                    while (iMinus > rMinus && rQuest > 0)
                    {
                        rMinus++;
                        rQuest--;
                        questAsMinus++;
                    }
                }
                if (iPlus > rPlus)
                {
                    while (iPlus > rPlus && rQuest > 0)
                    {
                        rPlus++;
                        rQuest--;
                        questAsPlus++;
                    }
                }

                if (rMinus != iMinus || rPlus != iPlus) prob = 0;
                else
                {
                    int distance = Math.Abs(endPosition - endPositionR);
                    if (endPosition < endPositionR) distance = -distance;

                    //Console.WriteLine("distance: {0}", distance);
                    //Console.WriteLine("minus: {0}",questAsMinus);
                    //Console.WriteLine("plus: {0}", questAsPlus);

                    double possibleWays = BC.combination(questAsMinus + questAsPlus, questAsPlus);
                    //Console.WriteLine("possible ways: {0}", possibleWays);

                    prob = possibleWays / Math.Pow(2, originalQuest);
                }

            }
            Console.WriteLine(prob);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Dreamoon d = new Dreamoon();
            d.countProbability();
        }
    }
}

using System;

namespace ConsoleApp1
{
    class Program
    {
		public static string drazil ="";
		public static string dreamoon="";

		public static char[] s1 = new char[drazil.ToCharArray().Length];
		public static char[] s2 = new char[dreamoon.ToCharArray().Length];

		public static int tamanhoS1, tamanhoS2;
		public static int unidade = 0, prob = 0, soma = 0;
		public static void probabilidade(int n, int posicao)
		{

			if (n == tamanhoS2)
			{
				if (posicao == unidade)
					prob++;
				soma++;
				return;
			}
			//Se o comando for '+' a posição irá andar para a direção positiva da unidade
			if (s2[n] == '+')
			{
				probabilidade(n + 1, posicao + 1);
			}
			//Se o comando for '-' a posição irá andar para a direção negativa da unidade
			else if (s2[n] == '-')
			{
				probabilidade(n + 1, posicao - 1);
			}
			else if (s2[n] == '?')
			{
				probabilidade(n + 1, posicao + 1);
				probabilidade(n + 1, posicao - 1);
			}
		}
		static void Main(string[] args)
        {
			Console.WriteLine("Comando Drazil: ");
			drazil = Console.ReadLine();
			Console.WriteLine("Comando Dreamoon: ");
			dreamoon = Console.ReadLine();

			s1 = drazil.ToCharArray();
			s2 = dreamoon.ToCharArray();

			tamanhoS1 = s1.Length;
			tamanhoS2 = s2.Length;

			//conta o número de unidades do comando da Drazil
			for (int i = 0; i < tamanhoS1; i++)
            {
				if (s1[i] == '+')
					unidade++;
				else
					unidade--;
			}

			probabilidade(0, 0);
			Console.WriteLine("Probabilidade: " + (double)(prob) / (soma));

		}
	}
}

using System;

namespace ConsoleApp1
{
    class Program
    {
		public static string drazil ="";
		public static string dreamoon="";

		public static char[] s1 = new char[drazil.ToCharArray().Length];
		public static char[] s2 = new char[dreamoon.ToCharArray().Length];

		public static int tamanhoS1, tamanhoS2;
		public static int unidade = 0, prob = 0, soma = 0;
		public static void probabilidade(int n, int posicao)
		{

			if (n == tamanhoS2)
			{
				if (posicao == unidade)
					prob++;
				soma++;
				return;
			}
			if (s2[n] == '+')
			{
				probabilidade(n + 1, posicao + 1);
			}
			else if (s2[n] == '-')
			{
				probabilidade(n + 1, posicao - 1);
			}
			else if (s2[n] == '?')
			{
				probabilidade(n + 1, posicao + 1);
				probabilidade(n + 1, posicao - 1);
			}
		}
		static void Main(string[] args)
        {
			Console.WriteLine("Comando Drazil: ");
			drazil = Console.ReadLine();
			Console.WriteLine("Comando Dreamoon: ");
			dreamoon = Console.ReadLine();

			s1 = drazil.ToCharArray();
			s2 = dreamoon.ToCharArray();

			tamanhoS1 = s1.Length;
			tamanhoS2 = s2.Length;

			for (int i = 0; i < tamanhoS1; i++)
            {
				if (s1[i] == '+')
					unidade++;
				else
					unidade--;
			}

			probabilidade(0, 0);
			Console.WriteLine ((double)(prob) / (soma));

		}
	}
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Program
    {
        static double faktorijal(int a)
        {
            if (a == 0) return 1;
            double f = 1;
            for (int i = 2; i <= a; i++) f *= i;
            return f;
        }
        static double NnadK(int n, int k)
        {
            return faktorijal(n) / (faktorijal(k) * faktorijal(n - k));
        }
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int poz1 = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') poz1++;
                else poz1--;
            }
            int poz2 = 0;
            int brUpitnika = 0;
            for (int i = 0; i < s2.Length; i++)
            {
                if (s2[i] == '+') poz2++;
                else if (s2[i] == '-') poz2--;
                else brUpitnika++;
            }
            if (brUpitnika == 0)
            {
                Console.WriteLine(1);
                return;
            }
            double nepovoljniSlucajevi = 1;
            for (int i = 0; i < brUpitnika; i++) nepovoljniSlucajevi *= 2;
            double povoljniSlucajevi = 0;
            for (int i = 0; i <= brUpitnika; i++)
            {
                int slucaj = i - (brUpitnika - i);
                if (poz2 + slucaj == poz1)
                {
                    povoljniSlucajevi += NnadK(brUpitnika, i);
                    break;
                }
            }
            Console.WriteLine((povoljniSlucajevi / nepovoljniSlucajevi).ToString().Replace(',', '.'));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Program
    {
        static double faktorijal(int a)
        {
            if (a == 0) return 1;
            double f = 1;
            for (int i = 2; i <= a; i++) f *= i;
            return f;
        }
        static double NnadK(int n, int k)
        {
            return faktorijal(n) / (faktorijal(k) * faktorijal(n - k));
        }
        static void Main(string[] args)
        {
            string s1 = Console.ReadLine();
            string s2 = Console.ReadLine();
            int poz1 = 0;
            for (int i = 0; i < s1.Length; i++)
            {
                if (s1[i] == '+') poz1++;
                else poz1--;
            }
            int poz2 = 0;
            int brUpitnika = 0;
            for (int i = 0; i < s2.Length; i++)
            {
                if (s2[i] == '+') poz2++;
                else if (s2[i] == '-') poz2--;
                else brUpitnika++;
            }
            if (brUpitnika == 0)
            {
                Console.WriteLine(1);
                Console.ReadLine();
                return;
            }
            double nepovoljniSlucajevi = 2 * brUpitnika;
            double povoljniSlucajevi = 0;
            for (int i = 0; i <= brUpitnika; i++)
            {
                int slucaj = i - (brUpitnika - i);
                if (poz2 + slucaj == poz1)
                {
                    povoljniSlucajevi += NnadK(brUpitnika, i);
                    break;
                }
            }
            Console.WriteLine((povoljniSlucajevi / nepovoljniSlucajevi).ToString().Replace(',', '.'));
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else if(temp%2==0&&unrecorg%2==0)
            {
                int a = (unrecorg + temp) / 2, bas = Convert.ToInt32(Math.Pow(2, unrecorg));
                double div = 1;
                for (int i = 0; i < a; i++)
                    div *= unrecorg - i;
                while (a > 0)
                    div /= a--;
                Console.WriteLine((div/bas).ToString("#.#########"));
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else if(temp%2==0&&unrecorg%2==0)
            {
                int a = (unrecorg + temp) / 2, bas = Convert.ToInt32(Math.Pow(2, unrecorg));
                double div = 1;
                for (int i = 0; i < a; i++)
                    div *= unrecorg - i;
                while (a > 0)
                    div /= a--;
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else if(temp%2==0&&unrecorg%2==0)
            {
                int a = (unrecorg + temp) / 2, bas = Convert.ToInt32(Math.Pow(2, unrecorg));
                double div = 1;
                for (int i = 0; i < a; i++)
                    div *= unrecorg - i;
                while (a > 0)
                    div /= a--;
                Console.WriteLine((div/bas).ToString("#.#########").Replace(',','.'));
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else if(temp%2==0&&unrecorg%2==0)
            {
                int a = (unrecorg + temp) / 2, bas = Convert.ToInt32(Math.Pow(2, unrecorg));
                double div = 1;
                for (int i = 0; i < a; i++)
                    div *= unrecorg - i;
                while (a > 0)
                    div /= a--;
                Console.WriteLine((div/bas).ToString("#.#########"));
                Console.WriteLine("div:{0},bas:{1}", div, bas);
            }

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace B
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            string command = Console.ReadLine();
            string receive = Console.ReadLine();
            int p_1 = 0, p_2 = 0, unrecorg = 0;
            foreach (var item in command)
                if (item == '+')
                    p_1++;
            foreach(var item in receive)
            {
                if (item == '+')
                    p_2++;
                else if (item == '?')
                    unrecorg++;
            }
            int m_1 = command.Length - p_1, m_2 = receive.Length - unrecorg - p_2;
            int des = p_1 - m_1, cur = p_2 - m_2;
            int temp = Math.Abs(des - cur);
            if(temp>unrecorg)
            {
                Console.WriteLine("0.000000000");
            }
            else if(unrecorg==0&&temp==0)
            {
                Console.WriteLine("1.000000000");
            }
            else if(temp%2==0&&unrecorg%2==0)
            {
                int a = (unrecorg + temp) / 2;
                Console.WriteLine((a / Math.Pow(2, unrecorg)).ToString("#.#########"));
            }

        }
    }
}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };
            int pre = receive.Count(r => r == '?');

            double prob = 0;

            if (pre == 0)
            {
                bool total = pos[0] == pos[1] && neg[0] == neg[1];
                prob = total ? 1 : 0;
            }
            else
            {
                prob = ((double)Factorial(pre) / (Factorial(pre - (pos[0] - pos[1])) * Factorial(pos[0] - pos[1]))) / Math.Pow(2, pre);
            }

            Console.WriteLine("{0:N12}", prob);
        }

        private static int Factorial(int num)
        {
            int total = 1;

            if (num == 0)
                return 1;

            for (int i = 1; i <= num; i++)
            {
                total *= i;
            }
            return total;
        }
    }
}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };

            float prob = 0;
            if (pos[0] > 0 && pos[1] > 0)
            {
                prob += ((pos[1]) / (float)pos[0]) / 2;
            }
            if (neg[0] > 0 && neg[1] > 0)
            {
                prob += ((neg[1]) / (float)neg[0]) / 2;
            }

            Console.WriteLine("{0:N12}", prob);
        }
    }
}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };
            int pre = receive.Count(r => r == '?');

            double prob = 0;

            if (pre == 0)
            {
                bool total = pos[0] == pos[1] && neg[0] == neg[1];
                prob = total ? 1 : 0;
            }
            else
            {
                if (pos[0] > pos[1] || neg[0] > neg[0])
                {
                    prob = ((double)Factorial(pre) / (Factorial(pre - (pos[0] - pos[1])) * Factorial(pos[0] - pos[1]))) / Math.Pow(2, pre);
                }
            }

            Console.WriteLine("{0:N12}", prob);
        }

        private static int Factorial(int num)
        {
            int total = 1;

            if (num == 0)
                return 1;

            for (int i = 1; i <= num; i++)
            {
                total *= i;
            }
            return total;
        }
    }
}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };
            int pre = receive.Count(r => r == '?');

            double prob = 0;

            if (pre == 0)
            {
                bool total = pos[0] == pos[1] && neg[0] == neg[1];
                prob = total ? 1 : 0;
            }
            else
            {
                if (pos[0] > pos[1] && neg[0] > neg[1])
                {
                    prob = ((double)Factorial(pre) / (Factorial(pre - (pos[0] - pos[1])) * Factorial(pos[0] - pos[1]))) / Math.Pow(2, pre);
                }
            }

            Console.WriteLine("{0:N12}", prob);
            //Console.ReadKey();
        }

        private static int Factorial(int num)
        {
            int total = 1;

            if (num == 0)
                return 1;

            for (int i = 1; i <= num; i++)
            {
                total *= i;
            }
            return total;
        }
    }
}

using System;
using System.Linq;

namespace B476
{
    class Program
    {
        static void Main(string[] args)
        {
            string sent = Console.ReadLine();
            string receive = Console.ReadLine();

            int count = receive.Count();
            int[] pos = new int[2] { sent.Count(p => p == '+'), receive.Count(p => p == '+') };
            int[] neg = new int[2] { sent.Count(n => n == '-'), receive.Count(n => n == '-') };

            float prob = 0;
            if (pos[0] > 0)
            {
                prob += ((pos[1]) / (float)pos[0]) / 2;
            }
            if (neg[0] > 0)
            {
                prob += ((neg[1]) / (float)neg[0]) / 2;
            }

            Console.WriteLine("{0:N12}", prob);

        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
     class Codigo
    {
         private string dreamoon;
         private string drazil;
         private int[] contaDreamon = new int[2];
         private int[] contaDrazil = new int[2];
         private int quantInt;

        public Codigo(string dreamoon, string drazil)
        {
            this.dreamoon = dreamoon;
            this.drazil = drazil;
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1;
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = drazil.Split(new char[] { '?' }).Length - 1;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDrazil[1] == contaDrazil[1])
            {
                return 1;
            }
            else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0))
                return 0;
            else
                return ((double)(drazil.Length - quantInt) / dreamoon.Length);
        }

        public void exibe()
        {
            double result = compara();
            Console.WriteLine("{0:F12}", result);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine());
            cod.exibe();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Codigo
    {
        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos

            posDreamoon = contaDreamon[1] - contaDreamon[0];
            posDrazil = contaDrazil[1] - contaDreamon[1];
            //for (int i = 0; i < dreamoon.Length; i++) //Esse for realiza a cont
            //{
            //    if (dreamoon.Substring(i, 1) == "+")
            //        posDreamoon++;
            //    else if (dreamoon.Substring(i, 1) == "-")
            //        posDreamoon--;
            //}

            //for (int i = 0; i < drazil.Length; i++)
            //{
            //    if (drazil.Substring(i, 1) == "+")
            //        posDrazil++;
            //    else
            //        posDrazil--;
            //}

            distancia = posDrazil - posDreamoon;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if (quantInt < Math.Abs(distancia)) //Se a quantidade de caminhos duvidosos for maior que a distância restante, a chance é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m))));

                return (double)combinacao / (1 << quantInt);
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            //Teste x = new Teste();
            //x.calcula(Console.ReadLine(), Console.ReadLine());
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Teste
    {
        public Array dreamoon;
        public Array drazil;
        int posResposta = 0;
        int posFinal = 0;
        int numInterrogacao = 0;

        public void calcula(string x, string y)
        {
            dreamoon = x.ToArray();
            drazil = y.ToArray();

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (dreamoon.GetValue(i).ToString() == "+")
                    posResposta++;
                else
                    posResposta--;
            }

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (drazil.GetValue(i).ToString() == "?")
                    numInterrogacao++;
                else if (drazil.GetValue(i).ToString() == "+")
                    posFinal++;
                else
                    posFinal--;
            }

            int distance = posResposta - posFinal;

            double answer;
            if ((distance + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distance))
                answer = 0;
            else
            {
                answer = (double)1 / (Math.Pow(2, numInterrogacao));
                Console.WriteLine(answer);
            }
        }
    }
    //   class Codigo
    //  {
    ////Iniciando as variáveis dreamoon e drazil
    //       private string dreamoon;
    //       private string drazil;

    ////Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
    //       private int[] contaDreamon = new int[2];
    //       private int[] contaDrazil = new int[2];

    ////Quantidade de valores desconhecidos passados ao drazil
    //       private int quantInt;

    //      public Codigo(string dreamoon, string drazil)
    //      {
    //          this.dreamoon = dreamoon; //Iniciando valores
    //          this.drazil = drazil; //Iniciando valores
    //          contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
    //          contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
    //          contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
    //          contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
    //          quantInt = drazil.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
    //      }

    //      private double compara()
    //      {
    //          if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
    //          {
    //              return 1;
    //          }
    //          else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0)) //Se receber valores incorretos, a probabilidade é zero
    //              return 0;
    //          else
    //              return ((double)(drazil.Length - quantInt) / dreamoon.Length); //Se não for nenhum disso, ele calcula a probabilidade de o Drazil retornar a posição original
    //      }

    //      public void exibe()
    //      {
    //          string result = compara().ToString();
    //          result = result.Replace(',', '.');
    //          Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
    //      }
    //  }
    class Program
    {
        static void Main(string[] args)
        {
            Teste x = new Teste();
            x.calcula(Console.ReadLine(), Console.ReadLine());
            //Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            //cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Teste
    {
        public Array dreamoon;
        public Array drazil;
        int posResposta = 0;
        int posFinal = 0;
        int numInterrogacao = 0;

        public void calcula(string x, string y)
        {
            dreamoon = x.ToArray();
            drazil = y.ToArray();

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (dreamoon.GetValue(i).ToString() == "+")
                    posResposta++;
                else
                    posResposta--;
            }

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (drazil.GetValue(i).ToString() == "?")
                    numInterrogacao++;
                else if (drazil.GetValue(i).ToString() == "+")
                    posFinal++;
                else
                    posFinal--;
            }

            int distance = posResposta - posFinal;
            int aaa;
            double answer;
            if ((distance + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distance)) //can't reach the destination no matter how
                answer = 0;
            else
            {
                int m = (numInterrogacao + Math.Abs(distance)) / 2; //moves needed toward the distance m is abs(distance)+(moves-abs(distance))/2
                                                                    //answer is C(moves,m)/(1<<moves)
                int c = 1;
                for (int i = 0; i < m; i++)
                    c *= numInterrogacao - i;
                for (int i = 2; i <= m; i++)
                    c /= i;

                answer = (double)c / (1 << numInterrogacao);

                Console.WriteLine(answer);
            }
        }
    }
    //   class Codigo
    //  {
    ////Iniciando as variáveis dreamoon e drazil
    //       private string dreamoon;
    //       private string drazil;

    ////Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
    //       private int[] contaDreamon = new int[2];
    //       private int[] contaDrazil = new int[2];

    ////Quantidade de valores desconhecidos passados ao drazil
    //       private int quantInt;

    //      public Codigo(string dreamoon, string drazil)
    //      {
    //          this.dreamoon = dreamoon; //Iniciando valores
    //          this.drazil = drazil; //Iniciando valores
    //          contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
    //          contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
    //          contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
    //          contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
    //          quantInt = drazil.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
    //      }

    //      private double compara()
    //      {
    //          if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
    //          {
    //              return 1;
    //          }
    //          else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0)) //Se receber valores incorretos, a probabilidade é zero
    //              return 0;
    //          else
    //              return ((double)(drazil.Length - quantInt) / dreamoon.Length); //Se não for nenhum disso, ele calcula a probabilidade de o Drazil retornar a posição original
    //      }

    //      public void exibe()
    //      {
    //          string result = compara().ToString();
    //          result = result.Replace(',', '.');
    //          Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
    //      }
    //  }
    class Program
    {
        static void Main(string[] args)
        {
            Teste x = new Teste();
            x.calcula(Console.ReadLine(), Console.ReadLine());
            //Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            //cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    //class Teste
    //{
    //    public Array dreamoon;
    //    public Array drazil;
    //    int posResposta = 0;
    //    int posFinal = 0;
    //    int numInterrogacao = 0;

    //    public void calcula(string x, string y)
    //    {
    //        dreamoon = x.ToArray();
    //        drazil = y.ToArray();

    //        for (int i = 0; i < dreamoon.Length; i++)
    //        {
    //            if (dreamoon.GetValue(i).ToString() == "+")
    //                posResposta++;
    //            else
    //                posResposta--;
    //        }

    //        for (int i = 0; i < dreamoon.Length; i++)
    //        {
    //            if (drazil.GetValue(i).ToString() == "?")
    //                numInterrogacao++;
    //            else if (drazil.GetValue(i).ToString() == "+")
    //                posFinal++;
    //            else
    //                posFinal--;
    //        }

    //        int distancia = posResposta - posFinal;
    //        double resposta;
    //        if ((distancia + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distancia)) //can't reach the destination no matter how
    //            resposta = 0;
    //        else
    //        {

    //        }

    //        Console.WriteLine(resposta);
    //    }
    //}
    class Codigo
    {
        //Iniciando as variáveis dreamoon e drazil
        private string dreamoon;
        private string drazil;

        //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
        private int[] contaDreamon = new int[2];
        private int[] contaDrazil = new int[2];

        //Quantidade de valores desconhecidos passados ao drazil
        private int quantInt;

        private int distancia;
        private int posDreamoon;
        private int posDrazil;

        public Codigo(string drazil, string dreamoon)
        {
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = dreamoon.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (dreamoon.Substring(i, 1) == "+")
                    posDreamoon++;
                else if (dreamoon.Substring(i, 1) == "-")
                    posDreamoon--;
            }

            for (int i = 0; i < drazil.Length; i++)
            {
                if (drazil.Substring(i, 1) == "+")
                    posDrazil++;
                else
                    posDrazil--;
            }

            distancia = posDrazil - posDreamoon;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0)) //Se receber valores incorretos, a probabilidade é zero
                return 0;
            else
            {
                int m = (quantInt + Math.Abs(distancia)) / 2; //Calcula a quantidade de passos válidos para chegar na posição correta

                double combinacao = (fatorial(quantInt) / (fatorial(quantInt - m) * (fatorial(m))));

                return (double)combinacao / (1 << quantInt);
            }
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }

        private double fatorial(int n)
        {
            if (n == 1 || n == 0)
                return 1;
            else
                return (n * fatorial(n - 1));
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            //Teste x = new Teste();
            //x.calcula(Console.ReadLine(), Console.ReadLine());
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
     class Codigo
    {
         private string dreamoon;
         private string drazil;
         private int[] contaDreamon = new int[2];
         private int[] contaDrazil = new int[2];
         private int quantInt;

        public Codigo(string dreamoon, string drazil)
        {
            this.dreamoon = dreamoon;
            this.drazil = drazil;
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1;
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = drazil.Split(new char[] { '?' }).Length - 1;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDrazil[1] == contaDrazil[1])
            {
                return 1;
            }
            else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0))
                return 0;
            else
                return ((double)(drazil.Length - quantInt) / dreamoon.Length);
        }

        public void exibe()
        {
            Console.WriteLine("{0:F12}", compara());
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine());
            cod.exibe();
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
     class Codigo
    {
	 //Iniciando as variáveis dreamoon e drazil
         private string dreamoon;
         private string drazil;

	 //Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
         private int[] contaDreamon = new int[2];
         private int[] contaDrazil = new int[2];

	 //Quantidade de valores desconhecidos passados ao drazil
         private int quantInt;

        public Codigo(string dreamoon, string drazil)
        {
            this.dreamoon = dreamoon; //Iniciando valores
            this.drazil = drazil; //Iniciando valores
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = drazil.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDrazil[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
            {
                return 1;
            }
            else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0)) //Se receber valores incorretos, a probabilidade é zero
                return 0;
            else
                return ((double)(drazil.Length - quantInt) / dreamoon.Length); //Se não for nenhum disso, ele calcula a probabilidade de o Drazil retornar a posição original
        }

        public void exibe()
        {
            string result = compara().ToString();
            result = result.Replace(',', '.');
            Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
    class Teste
    {
        public Array dreamoon;
        public Array drazil;
        int posResposta = 0;
        int posFinal = 0;
        int numInterrogacao = 0;

        public void calcula(string x, string y)
        {
            dreamoon = x.ToArray();
            drazil = y.ToArray();

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (dreamoon.GetValue(i).ToString() == "+")
                    posResposta++;
                else
                    posResposta--;
            }

            for (int i = 0; i < dreamoon.Length; i++)
            {
                if (drazil.GetValue(i).ToString() == "?")
                    numInterrogacao++;
                else if (drazil.GetValue(i).ToString() == "+")
                    posFinal++;
                else
                    posFinal--;
            }

            int distancia = posResposta - posFinal;
            double resposta;
            if ((distancia + numInterrogacao) % 2 != 0 || numInterrogacao < Math.Abs(distancia)) //can't reach the destination no matter how
                resposta = 0;
            else
            {
                resposta = (double)1 / (Math.Pow(2, numInterrogacao));
            }

            Console.WriteLine(resposta);
        }
    }
    //   class Codigo
    //  {
    ////Iniciando as variáveis dreamoon e drazil
    //       private string dreamoon;
    //       private string drazil;

    ////Iniciando um vetor que vai guardar os dois valores possíveis nas instruções
    //       private int[] contaDreamon = new int[2];
    //       private int[] contaDrazil = new int[2];

    ////Quantidade de valores desconhecidos passados ao drazil
    //       private int quantInt;

    //      public Codigo(string dreamoon, string drazil)
    //      {
    //          this.dreamoon = dreamoon; //Iniciando valores
    //          this.drazil = drazil; //Iniciando valores
    //          contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1; //Vai contar quantos '-' possui e vai passar para a variável, e assim respectivamente com as 3 próxima linhas
    //          contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
    //          contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
    //          contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
    //          quantInt = drazil.Split(new char[] { '?' }).Length - 1; //Quantidade de códigos desconhecidos
    //      }

    //      private double compara()
    //      {
    //          if (contaDreamon[0] == contaDrazil[0] && contaDreamon[1] == contaDrazil[1]) //Se receberem a mesma quantidade de '+' e '-', a conta termina em 100%
    //          {
    //              return 1;
    //          }
    //          else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0)) //Se receber valores incorretos, a probabilidade é zero
    //              return 0;
    //          else
    //              return ((double)(drazil.Length - quantInt) / dreamoon.Length); //Se não for nenhum disso, ele calcula a probabilidade de o Drazil retornar a posição original
    //      }

    //      public void exibe()
    //      {
    //          string result = compara().ToString();
    //          result = result.Replace(',', '.');
    //          Console.WriteLine("{0:F12}", result); //Exibe o resultado com 12 algarismos
    //      }
    //  }
    class Program
    {
        static void Main(string[] args)
        {
            Teste x = new Teste();
            x.calcula(Console.ReadLine(), Console.ReadLine());
            //Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine()); //Chama a função com os dois valores digitados
            //cod.exibe(); //Exibe o resultado em decimal
        }
    }
}

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Dreamoon_and_WiFi
{
     class Codigo
    {
         private string dreamoon;
         private string drazil;
         private int[] contaDreamon = new int[2];
         private int[] contaDrazil = new int[2];
         private int quantInt;

        public Codigo(string dreamoon, string drazil)
        {
            this.dreamoon = dreamoon;
            this.drazil = drazil;
            contaDreamon[0] = dreamoon.Split(new char[] { '-' }).Length - 1;
            contaDreamon[1] = dreamoon.Split(new char[] { '+' }).Length - 1;
            contaDrazil[0] = drazil.Split(new char[] { '-' }).Length - 1;
            contaDrazil[1] = drazil.Split(new char[] { '+' }).Length - 1;
            quantInt = drazil.Split(new char[] { '?' }).Length - 1;
        }

        private double compara()
        {
            if (contaDreamon[0] == contaDrazil[0] && contaDrazil[1] == contaDrazil[1])
            {
                return 1;
            }
            else if ((contaDreamon[0] == 0 && contaDrazil[0] != 0) || (contaDreamon[1] == 0 && contaDrazil[1] != 0))
                return 0;
            else
                return ((double)(drazil.Length - quantInt) / dreamoon.Length);
        }

        public void exibe()
        {
            double result = compara();
            Console.WriteLine(result);
        }
    }
    class Program
    {
        static void Main(string[] args)
        {
            Codigo cod = new Codigo(Console.ReadLine(), Console.ReadLine());
            cod.exibe();
        }
    }
}

#region Usings
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;

using static System.Math;
#endregion

// https://codeforces.com/problemset/problem/476/B
public class B___Dreamoon_and_WiFi
{
    private static void Solve()
    {
        string a = Read();
        string b = Read();

        int pluses = 0;
        int minuses = 0;

        for (int i = 0; i < a.Length; i++)
        {
            char cur = a[i];
            if (cur == '-')
                minuses++;
            else // '+'
                pluses++;
        }

        for (int i = 0; i < b.Length; i++)
        {
            char cur = b[i];
            if (cur == '-')
                minuses = Max(0, minuses - 1);
            else if (cur == '+')
                pluses = Max(0, pluses - 1);
        }

        float prob = (Abs(pluses) + Abs(minuses)) / (float)a.Length;
        Write(1 - prob);
    }

    #region Main

    private static TextReader reader;
    private static TextWriter writer;

    public static void Main()
    {
#if DEBUG

        //reader = new StreamReader("C:\\Users\\Axel\\Desktop\\input.txt");
        reader = new StreamReader(Console.OpenStandardInput());
        writer = Console.Out;

        //writer = new StreamWriter("..\\..\\output.txt");
#else
        reader = new StreamReader(Console.OpenStandardInput());
        writer = new StreamWriter(Console.OpenStandardOutput());

        //reader = new StreamReader("input.txt");
        //writer = new StreamWriter("output.txt");
#endif
        try
        {
            Solve();

            //var thread = new Thread(new String_Task().Solve, 1024 * 1024 * 128);
            //thread.Start();
            //thread.Join();
        }
        catch (Exception ex)
        {
            Console.WriteLine(ex);
#if DEBUG
#else
            throw;
#endif
        }
        reader.Close();
        writer.Close();
    }

    #endregion Main

    #region Read / Write

    private static Queue<string> currentLineTokens = new Queue<string>();

    private static string[] ReadAndSplitLine()
    {
        return reader.ReadLine().Split(new[] { ' ', '\t', }, StringSplitOptions.RemoveEmptyEntries);
    }

    public static string Read()
    {
        while (currentLineTokens.Count == 0) currentLineTokens = new Queue<string>(ReadAndSplitLine()); return currentLineTokens.Dequeue();
    }

    public static int ReadInt()
    {
        return int.Parse(Read());
    }

    public static long ReadLong()
    {
        return long.Parse(Read());
    }

    public static double ReadDouble()
    {
        return double.Parse(Read(), CultureInfo.InvariantCulture);
    }

    public static int[] ReadIntArray()
    {
        return ReadAndSplitLine().Select(int.Parse).ToArray();
    }

    public static long[] ReadLongArray()
    {
        return ReadAndSplitLine().Select(long.Parse).ToArray();
    }

    public static double[] ReadDoubleArray()
    {
        return ReadAndSplitLine().Select(s => double.Parse(s, CultureInfo.InvariantCulture)).ToArray();
    }

    public static int[][] ReadIntMatrix(int numberOfRows)
    {
        int[][] matrix = new int[numberOfRows][]; for (int i = 0; i < numberOfRows; i++) matrix[i] = ReadIntArray(); return matrix;
    }

    public static int[][] ReadAndTransposeIntMatrix(int numberOfRows)
    {
        int[][] matrix = ReadIntMatrix(numberOfRows); int[][] ret = new int[matrix[0].Length][];
        for (int i = 0; i < ret.Length; i++) { ret[i] = new int[numberOfRows]; for (int j = 0; j < numberOfRows; j++) ret[i][j] = matrix[j][i]; }
        return ret;
    }

    public static string[] ReadLines(int quantity)
    {
        string[] lines = new string[quantity]; for (int i = 0; i < quantity; i++) lines[i] = reader.ReadLine().Trim(); return lines;
    }

    public static void WriteArray<T>(IEnumerable<T> array)
    {
        writer.WriteLine(string.Join(" ", array));
    }

    public static void Write(params object[] array)
    {
        WriteArray(array);
    }

    public static void WriteLines<T>(IEnumerable<T> array)
    {
        foreach (var a in array) writer.WriteLine(a);
    }

    private class SDictionary<TKey, TValue> : Dictionary<TKey, TValue>
    {
        public new TValue this[TKey key]
        {
            get { return ContainsKey(key) ? base[key] : default(TValue); }
            set { base[key] = value; }
        }
    }

    private static T[] Init<T>(int size) where T : new()
    {
        var ret = new T[size]; for (int i = 0; i < size; i++) ret[i] = new T(); return ret;
    }

    #endregion Read / Write
}